p

zio

http

package http

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. http
  2. MdInterpolator
  3. UrlInterpolator
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Package Members

  1. package codec
  2. package endpoint
  3. package internal
  4. package template

Type Members

  1. 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.).

  2. final case class Boundary(id: String, charset: Charset) extends Product with Serializable

    A multipart boundary, which consists of both the boundary and its charset.

  3. trait Channel[-In, +Out] extends AnyRef

    A Channel is an asynchronous communication channel that supports receiving messages of type In and sending messages of type Out.

  4. 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.

  5. type Client = ZClient[Any, Body, Throwable, Response]
  6. sealed trait ClientAuth extends AnyRef
  7. trait ClientDriver extends AnyRef
  8. sealed trait ClientSSLConfig extends AnyRef
  9. trait ComposeLowPriorityImplicits extends AnyRef
  10. trait ConnectionPool[Connection] extends AnyRef
  11. sealed trait ConnectionPoolConfig extends AnyRef
  12. 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.

  13. final case class Credentials(uname: String, upassword: Secret) extends Product with Serializable
  14. sealed trait Decompression extends AnyRef
  15. trait DnsResolver extends AnyRef
  16. trait Driver extends AnyRef
  17. trait DriverPlatformSpecific extends AnyRef
  18. sealed trait Flash[+A] extends AnyRef

    Flash represents a flash value that one can retrieve from the flash scope.

    Flash represents a flash value that one can retrieve from the flash scope.

    The flash scope consists of a serialized and url-encoded json object built with zio-schema.

  19. final case class Form(formData: Chunk[FormField]) extends Product with Serializable

    Represents a form that can be either multipart or url encoded.

  20. sealed trait FormDecodingError extends Exception

    Represents a form decoding error.

  21. 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.

  22. sealed trait Handler[-R, +Err, -In, +Out] extends AnyRef
  23. final case class HandlerAspect[-Env, +CtxOut](protocol: ProtocolStack[Env, Request, (Request, CtxOut), Response, Response]) extends Middleware[Env] with Product with Serializable

    A zio.http.HandlerAspect is a kind of zio.http.ProtocolStack that is specialized to transform a handler's incoming requests and outgoing responses.

    A zio.http.HandlerAspect is a kind of zio.http.ProtocolStack that is specialized to transform a handler's incoming requests and outgoing responses. Each layer in the stack corresponds to a separate transformation.

    Layers may incorporate layer-specific information into a generic type parameter, referred to as middleware context, which composes using tupling.

    Layers may also be stateful at the level of each transformation application. So, for example, a layer that is timing request durations may capture the start time of the request in the incoming interceptor, and pass this state to the outgoing interceptor, which can then compute the duration.

    zio.http.HandlerAspect is more than just a wrapper around zio.http.ProtocolStack, as its concatenation operator has been specialized to entuple contexts, so that each layer may only add context to the contextual output.

  24. trait HandlerPlatformSpecific extends AnyRef
  25. sealed trait Header extends AnyRef
  26. 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 by HeaderExtension.

  27. final case class HttpApp[-Env](routes: Routes[Env, Response]) extends PartialFunction[Request, ZIO[Env, Response, Response]] with Product with Serializable

    An HTTP application is a collection of routes, all of whose errors have been handled through conversion into HTTP responses.

    An HTTP application is a collection of routes, all of whose errors have been handled through conversion into HTTP responses.

    HTTP applications can be installed into a zio.http.Server, which is capable of using them to serve requests.

  28. trait MdInterpolator extends AnyRef
  29. implicit class MdInterpolatorHelper extends AnyRef
    Definition Classes
    MdInterpolator
  30. 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
  31. sealed trait Method extends AnyRef

    Represents an HTTP method, such as GET, PUT, POST, or DELETE.

  32. trait Middleware[-UpperEnv] extends AnyRef
  33. final case class Path extends Product with Serializable

    Path is an immutable representation of the path of a URL.

    Path is an immutable representation of the path of a URL. Internally it stores each element of a path in a sequence of text, together with flags on whether there are leading and trailing slashes in the path. This allows for a combination of precision and performance and supports a rich API.

  34. sealed trait ProtocolStack[-Env, -IncomingIn, +IncomingOut, -OutgoingIn, +OutgoingOut] extends AnyRef

    A zio.http.ProtocolStack represents a linear stack of protocol layers, each of which can statefully transform incoming and outgoing values of some handler.

    A zio.http.ProtocolStack represents a linear stack of protocol layers, each of which can statefully transform incoming and outgoing values of some handler.

    Protocol stacks can be thought of as a formal model of the process of transforming one handler into another handler.

    Protocol stacks are designed to support precise semantics around error handling. In particular, if a layer successfully processes an incoming value of a handler, then that same layer will also have a chance to process the outgoing value of the handler. This requirement constrains the ways in which layers can fail, and the types of handlers they may be applied to.

    In particular, protocol stacks can be applied to handlers that fail with the same type as their output type. This guarantees that should a handler fail, it will still produce an outgoing value that can be processed by all the layers that successfully transformed the incoming value.

    Further, a layer may only fail while it processes an incoming value, and it may only value with the same type as its outgoing value. This guarantees that should a layer fail, it will still produce an outgoing value that can be processed by all the earlier layers that successfully transformed the incoming value.

    In a way, the entire design of protocol stacks is geared at ensuring layers that successfully process incoming values will also have a chance to process outgoing values.

    The only composition operator on protocol stacks is ++, which simply chains two stacks together. This operator is associative and has an identity (which is the protocol stack that neither transforms incoming nor outgoing values, and which acts as an identity when used to transform handlers).

  35. 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

  36. trait QueryParams extends QueryOps[QueryParams]

    A collection of query parameters.

  37. sealed trait QueryParamsError extends Exception with NoStackTrace
  38. final case class Request(version: Version = Version.Default, method: Method = Method.ANY, url: URL = URL.empty, headers: Headers = Headers.empty, body: Body = Body.empty, remoteAddress: Option[InetAddress] = None) extends HeaderOps[Request] with QueryOps[Request] with Product with Serializable
  39. type RequestHandler[-R, +Err] = Handler[R, Err, Request, Response]
  40. final class RequestHandlerInput[A, I] extends AnyRef
    Annotations
    @implicitNotFound()
  41. final case class Response(status: Status = Status.Ok, headers: Headers = Headers.empty, body: Body = Body.empty) extends HeaderOps[Response] with Product with Serializable
  42. sealed trait Route[-Env, +Err] extends AnyRef
  43. abstract class RouteDecode[A] extends AnyRef
  44. final case class RoutePattern[A](method: Method, pathCodec: PathCodec[A]) extends Product with Serializable

    A pattern for matching routes that examines both HTTP method and path.

    A pattern for matching routes that examines both HTTP method and path. In addition to specifying a method, patterns contain segment patterns, which are sequences of literals, integers, longs, and other segment types.

    Typically, your entry point constructor for a route pattern would be zio.http.Method:

    import zio.http.Method
    import zio.http.codec.SegmentCodec._
    
    val pattern = Method.GET / "users" / int("user-id") / "posts" / string("post-id")

    However, you can use the convenience constructors in RoutePattern, such as RoutePattern.GET.

  45. final class Routes[-Env, +Err] extends AnyRef

    Represents a collection of routes, each of which is defined by a pattern and a handler.

    Represents a collection of routes, each of which is defined by a pattern and a handler. This data type can be thought of as modeling a routing table, which decides where to direct every endpoint in an API based on both method and path of the request.

    When you are done building a collection of routes, you typically convert the routes into an zio.http.HttpApp value, which can be done with the toHttpApp method.

    Routes may have handled or unhandled errors. A route of type Route[Env, Throwable], for example, has not handled its errors by converting them into responses. Such unfinished routes cannot yet be converted into zio.http.HttpApp values. First, you must handle errors with the handleError or handleErrorCause methods.

  46. final case class SSLConfig(behaviour: HttpBehaviour, data: Data, provider: Provider, clientAuth: Option[ClientAuth] = None) extends Product with Serializable
  47. sealed trait Scheme extends AnyRef
  48. trait Server extends AnyRef

    Represents a server, which is capable of serving zero or more HTTP applications.

  49. trait ServerPlatformSpecific extends AnyRef
  50. 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

  51. 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

  52. sealed trait Status extends Product with Serializable
  53. final case class StreamingForm(source: ZStream[Any, Throwable, Byte], boundary: Boundary, bufferSize: Int = 8192) extends Product with Serializable
  54. trait ToHandler[H] extends AnyRef
    Annotations
    @implicitNotFound()
  55. final case class URL(path: Path, kind: Location = URL.Location.Relative, queryParams: QueryParams = QueryParams.empty, fragment: Option[Fragment] = None) extends URLPlatformSpecific with QueryOps[URL] with Product with Serializable
  56. trait URLPlatformSpecific extends AnyRef
  57. trait UrlInterpolator extends AnyRef
  58. implicit class UrlInterpolatorHelper extends AnyRef
    Definition Classes
    UrlInterpolator
  59. sealed trait Version extends AnyRef
  60. final case class WebSocketApp[-R](handler: Handler[R, Throwable, WebSocketChannel, Any], customConfig: Option[WebSocketConfig]) extends Product with Serializable
  61. type WebSocketChannel = Channel[WebSocketChannelEvent, WebSocketChannelEvent]

    A channel that allows websocket frames to be written to it.

  62. type WebSocketChannelEvent = ChannelEvent[WebSocketFrame]

    A channel that allows websocket frames to be read and write to it.

  63. 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

  64. sealed trait WebSocketFrame extends Product with Serializable
  65. final case class ZClient[-Env, -In, +Err, +Out](version: Version, url: URL, headers: Headers, sslConfig: Option[ClientSSLConfig], proxy: Option[Proxy], bodyEncoder: BodyEncoder[Env, Err, In], bodyDecoder: BodyDecoder[Env, Err, Out], driver: ZClient.Driver[Env, Err]) extends HeaderOps[ZClient[Env, In, Err, Out]] with Product with Serializable
  66. 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.

  67. trait ZClientPlatformSpecific extends AnyRef
  68. trait ZCompose[+LeftLower, -LeftUpper, LeftOut[In], +RightLower, -RightUpper, RightOut[In]] extends AnyRef

Value Members

  1. def Client: ZClient.type
  2. val Empty: Path
  3. val Root: Path
  4. def boolean(name: String): PathCodec[Boolean]
  5. def handler[H](handler: => H)(implicit h: ToHandler[H]): Handler[Env, Err, In, Out]

    A smart constructor that attempts to construct a handler from the specified value.

    A smart constructor that attempts to construct a handler from the specified value. If you have difficulty using this function, then please use the constructors on zio.http.Handler directly.

  6. def handlerTODO(message: String): Handler[Any, Nothing, Any, Nothing]
  7. def int(name: String): PathCodec[Int]
  8. def long(name: String): PathCodec[Long]
  9. def string(name: String): PathCodec[String]
  10. val trailing: PathCodec[Path]
  11. def uuid(name: String): PathCodec[UUID]
  12. object Body
  13. object Boundary extends Serializable
  14. object ChannelEvent
  15. object Charsets
  16. object ClientAuth
  17. object ClientDriver
  18. object ClientSSLConfig
  19. object ConnectionPoolConfig
  20. object Cookie
  21. object Decompression
  22. object DnsResolver
  23. object Driver extends DriverPlatformSpecific
  24. object Flash
  25. object Form extends Serializable
  26. object FormDecodingError extends Serializable
  27. object FormField
  28. object Handler extends HandlerPlatformSpecific
  29. object HandlerAspect extends HandlerAspects with Serializable
  30. object Header
  31. object Headers
  32. object HttpApp extends Serializable
  33. object MediaType extends MediaTypes with Serializable
  34. object Method
  35. object Middleware extends HandlerAspects
  36. object Path extends Serializable
  37. object ProtocolStack
  38. object Proxy extends Serializable
  39. object QueryParams
  40. object QueryParamsError extends Serializable
  41. object Request extends Serializable
  42. object RequestHandlerInput
  43. object Response extends Serializable
  44. object Route
  45. object RoutePattern extends Serializable
  46. object Routes
  47. object SSLConfig extends Serializable
  48. object Scheme
  49. object Server extends ServerPlatformSpecific
  50. object ServerSentEvent extends Serializable
  51. object SocketDecoder extends Serializable
  52. object Status extends Serializable
  53. object StreamingForm extends Serializable
  54. object ToHandler extends HandlerConstructorLowPriorityImplicits0
  55. object URL extends Serializable
  56. object Version
  57. object WebSocketApp extends Serializable
  58. object WebSocketConfig extends Serializable
  59. object WebSocketFrame extends Serializable
  60. object ZClient extends ZClientPlatformSpecific with Serializable
  61. object ZClientAspect
  62. object ZCompose extends ComposeLowPriorityImplicits

Inherited from MdInterpolator

Inherited from UrlInterpolator

Inherited from AnyRef

Inherited from Any

Ungrouped