package http
- Alphabetic
- By Inheritance
- http
- RouteDecoderModule
- RequestSyntax
- PathSyntax
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Package Members
Type Members
- type App[-R] = Http[R, Response, Request, Response]
- trait Body extends AnyRef
Represents the body of a request or response.
Represents the body of a request or response. The body can be a fixed chunk of bytes, a stream of bytes, or form data, or any type that can be encoded into such representations (such as textual data using some character encoding, the contents of files, JSON, etc.).
- final case class Boundary(id: String, charset: Charset) extends Product with Serializable
A multipart boundary, which consists of both the boundary and its charset.
- trait Channel[-In, +Out] extends AnyRef
A
Channel
is an asynchronous communication channel that supports receiving messages of typeIn
and sending messages of typeOut
. - sealed trait ChannelEvent[+A] extends AnyRef
Immutable and type-safe representation of events that are triggered on a netty channel.
Immutable and type-safe representation of events that are triggered on a netty channel.
A
represents the message type. - type Client = ZClient[Any, Body, Throwable, Response]
- trait ClientDriver extends AnyRef
- sealed trait ClientSSLConfig extends AnyRef
- trait ComposeLowPriorityImplicits extends AnyRef
- trait ConnectionPool[Connection] extends AnyRef
- sealed trait ConnectionPoolConfig extends AnyRef
- sealed trait Cookie extends AnyRef
Cookie is an immutable and type-safe representation of an HTTP cookie.
Cookie is an immutable and type-safe representation of an HTTP cookie. There are two types of cookies: request cookies and response cookies. These can be created with the constructors in the companion object of Cookie.
- sealed trait Decompression extends AnyRef
- trait DnsResolver extends AnyRef
- trait Driver extends AnyRef
- type EHttpApp = Http[Any, Throwable, Request, Response]
- trait Extractor extends AnyRef
Path is an immutable representation of a urls path.
Path is an immutable representation of a urls path. Internally it stores each element of a path in a sequence of
Segment
. This allows for powerful compositional APIs. - final case class Form(formData: Chunk[FormField]) extends Product with Serializable
Represents a form that can be either multipart or url encoded.
- sealed trait FormDecodingError extends Exception
Represents a form decoding error.
- sealed trait FormField extends AnyRef
Represents a field in a form.
Represents a field in a form. Every field contains name, content type (perhaps just plaintext), type-specific content, and an optional filename.
- sealed trait Handler[-R, +Err, -In, +Out] extends AnyRef
- type HandlerAspect[+LowerEnv, -UpperEnv, +LowerErr, -UpperErr] = Contextual[LowerEnv, UpperEnv, LowerErr, UpperErr] { ... /* 2 definitions in type refinement */ }
- sealed trait Header extends AnyRef
- sealed trait Headers extends HeaderOps[Headers] with Iterable[Header]
Represents an immutable collection of headers.
Represents an immutable collection of headers. It extends HeaderExtensions and has a ton of powerful operators that can be used to add, remove and modify headers.
NOTE: Generic operators that are not specific to
Headers
should not be defined here. A better place would be one of the traits extended byHeaderExtension
. - sealed trait Http[-R, +Err, -In, +Out] extends AnyRef
- type HttpApp[-R, +Err] = Http[R, Err, Request, Response]
- type HttpAppMiddleware[+LowerEnv, -UpperEnv, +LowerErr, -UpperErr] = Contextual[LowerEnv, UpperEnv, LowerErr, UpperErr] { ... /* 2 definitions in type refinement */ }
- sealed abstract class HttpError extends Throwable
- case class IntExtractor(int: Int) extends Extractor with Product with Serializable
- final case class MediaType(mainType: String, subType: String, compressible: Boolean = false, binary: Boolean = false, fileExtensions: List[String] = Nil, extensions: Map[String, String] = Map.empty, parameters: Map[String, String] = Map.empty) extends Product with Serializable
- sealed trait Method extends AnyRef
Represents an HTTP method, such as GET, PUT, POST, or DELETE.
- final case class Path extends Product with Serializable
- final case class Proxy(url: URL, credentials: Option[Credentials] = None, headers: Headers = Headers.empty) extends Product with Serializable
Represents the connection to the forward proxy before running the request
- final case class QueryParams(map: Map[String, Chunk[String]]) extends Product with Serializable
A collection of query parameters.
- type RHttpApp[-R] = Http[R, Throwable, Request, Response]
- final case class Request(body: Body, headers: Headers, method: Method, url: URL, version: Version, remoteAddress: Option[InetAddress]) extends HeaderOps[Request] with Product with Serializable
- type RequestHandler[-R, +Err] = Handler[R, Err, Request, Response]
- type RequestHandlerMiddleware[+LowerEnv, -UpperEnv, +LowerErr, -UpperErr] = Contextual[LowerEnv, UpperEnv, LowerErr, UpperErr] { ... /* 2 definitions in type refinement */ }
- sealed trait Response extends HeaderOps[Response]
- trait RouteDecoderModule extends AnyRef
Instead of using just
String
as path params, using the RouteDecoderModule we can extract and converted params into a specific type also.Instead of using just
String
as path params, using the RouteDecoderModule we can extract and converted params into a specific type also.scala Http.collect[Request] { case GET -> Root / "user" / int(id) => Response.text("User id requested: ${id}") case GET -> Root / "user" / name => Response.text("User name requested: ${name}") }
If the request looks like
GET /user/100
then it would match the first case. This is because internally theid
param can be decoded into anInt
. If a request of the formGET /user/zio
is made, in that case the second case is matched. - abstract class RouteDecode[A] extends AnyRef
- Definition Classes
- RouteDecoderModule
- final case class SSLConfig(behaviour: HttpBehaviour, data: Data, provider: Provider) extends Product with Serializable
- sealed trait Scheme extends AnyRef
- trait Server extends AnyRef
Represents a server, which is capable of serving zero or more HTTP applications.
- final case class ServerSentEvent(data: String, eventType: Option[String] = None, id: Option[String] = None, retry: Option[Int] = None) extends Product with Serializable
Server-Sent Event (SSE) as defined by https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
Server-Sent Event (SSE) as defined by https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events
- data
data, may span multiple lines
- eventType
optional type, must not contain \n or \r
- id
optional id, must not contain \n or \r
- retry
optional reconnection delay in milliseconds
- type SocketApp[-R] = Handler[R, Throwable, WebSocketChannel, Any]
- final case class SocketDecoder(maxFramePayloadLength: Int = 65536, expectMaskedFrames: Boolean = true, allowMaskMismatch: Boolean = false, allowExtensions: Boolean = false, closeOnProtocolViolation: Boolean = true, withUTF8Validator: Boolean = true) extends Product with Serializable
Frame decoder configuration
- sealed trait Status extends Product with Serializable
- final case class StreamingForm(source: ZStream[Any, Throwable, Byte], boundary: Boundary, bufferSize: Int = 8192) extends Product with Serializable
- type UHttp[-A, +B] = Http[Any, Nothing, A, B]
- type UHttpApp = Http[Any, Nothing, Request, Response]
- final case class URL(path: Path, kind: Location = URL.Location.Relative, queryParams: QueryParams = QueryParams.empty, fragment: Option[Fragment] = None) extends Product with Serializable
- sealed trait Version extends AnyRef
- type WebSocketChannel = Channel[WebSocketChannelEvent, WebSocketChannelEvent]
A channel that allows websocket frames to be written to it.
- type WebSocketChannelEvent = ChannelEvent[WebSocketFrame]
A channel that allows websocket frames to be read and write to it.
- final case class WebSocketConfig(subprotocols: Option[String] = None, handshakeTimeoutMillis: Long = 10000L, forceCloseTimeoutMillis: Long = -1L, handleCloseFrames: Boolean = true, sendCloseFrame: CloseStatus = WebSocketConfig.CloseStatus.NormalClosure, dropPongFrames: Boolean = true, decoderConfig: SocketDecoder = SocketDecoder.default) extends Product with Serializable
Server side websocket configuration
- sealed trait WebSocketFrame extends Product with Serializable
- trait ZClient[-Env, -In, +Err, +Out] extends HeaderOps[ZClient[Env, In, Err, Out]]
- trait ZClientAspect[+LowerEnv, -UpperEnv, +LowerIn, -UpperIn, +LowerErr, -UpperErr, +LowerOut, -UpperOut] extends AnyRef
A
ZClientAspect
is capable on modifying some aspect of the execution of a client, such as metrics, tracing, encoding, decoding, or logging. - trait ZCompose[+LeftLower, -LeftUpper, LeftOut[In], +RightLower, -RightUpper, RightOut[In]] extends AnyRef
Value Members
- def Client: ZClient.type
- val Empty: Path
- Definition Classes
- PathSyntax
- val Root: Path
- Definition Classes
- PathSyntax
- object ->
- Definition Classes
- RequestSyntax
- object /
- Definition Classes
- PathSyntax
- object /:
- Definition Classes
- PathSyntax
- object Body
- object Boundary extends Serializable
- object ChannelEvent
- object Charsets
- object ClientDriver
- object ClientSSLConfig
- object ConnectionPoolConfig
- object Cookie
- object Decompression
- object DnsResolver
- object Driver
- object Form extends Serializable
- object FormDecodingError extends Serializable
- object FormField
- object Handler
- object HandlerAspect
- object Header
- object Headers
- object Http
- object HttpAppMiddleware extends RequestHandlerMiddlewares with HttpRoutesMiddlewares
- object HttpError extends Serializable
- object HttpRoutesMiddlewares extends HttpRoutesMiddlewares
- object MediaType extends MediaTypes with Serializable
- object Method
- object Path extends Serializable
- object Proxy extends Serializable
- object QueryParams extends Serializable
- object Request extends Serializable
- object RequestHandlerMiddleware
- object RequestHandlerMiddlewares extends RequestHandlerMiddlewares
- object Response
- object boolean extends RouteDecode[Boolean]
- Definition Classes
- RouteDecoderModule
- object byte extends RouteDecode[Byte]
- Definition Classes
- RouteDecoderModule
- object date extends RouteDecode[LocalDate]
- Definition Classes
- RouteDecoderModule
- object double extends RouteDecode[Double]
- Definition Classes
- RouteDecoderModule
- object float extends RouteDecode[Float]
- Definition Classes
- RouteDecoderModule
- object int extends RouteDecode[Int]
- Definition Classes
- RouteDecoderModule
- object long extends RouteDecode[Long]
- Definition Classes
- RouteDecoderModule
- object short extends RouteDecode[Short]
- Definition Classes
- RouteDecoderModule
- object time extends RouteDecode[LocalDateTime]
- Definition Classes
- RouteDecoderModule
- object uuid extends RouteDecode[UUID]
- Definition Classes
- RouteDecoderModule
- object SSLConfig extends Serializable
- object Scheme
- object Server
- object ServerSentEvent extends Serializable
- object SocketDecoder extends Serializable
- object Status extends Serializable
- object StreamingForm extends Serializable
- object URL extends Serializable
- object Version
- object WebSocketConfig extends Serializable
- object WebSocketFrame extends Serializable
- object ZClient
- object ZClientAspect
- object ZCompose extends ComposeLowPriorityImplicits