Packages

p

zhttp

http

package http

Linear Supertypes
RouteDecoderModule, RequestSyntax, PathSyntax, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. http
  2. RouteDecoderModule
  3. RequestSyntax
  4. PathSyntax
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Type Members

  1. final case class Cookie(name: String, content: String, expires: Option[Instant] = None, domain: Option[String] = None, path: Option[Path] = None, isSecure: Boolean = false, isHttpOnly: Boolean = false, maxAge: Option[Long] = None, sameSite: Option[SameSite] = None, secret: Option[String] = None) extends Product with Serializable
  2. type Header = (CharSequence, CharSequence)
  3. final case class Headers(toChunk: Chunk[Header]) extends HeaderExtension[Headers] with Product with Serializable

    Represents an immutable collection of headers i.e.

    Represents an immutable collection of headers i.e. essentially a Chunk[(String, String)]. 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.

  4. sealed trait Http[-R, +E, -A, +B] extends (A) ⇒ ZIO[R, Option[E], B]

    A functional domain to model Http apps using ZIO and that can work over any kind of request and response types.

  5. type HttpApp[-R, +E] = Http[R, E, Request, Response]
  6. sealed trait HttpData extends AnyRef

    Holds HttpData that needs to be written on the HttpChannel

  7. sealed abstract class HttpError extends Throwable
  8. sealed trait IsMono[-AIn, +BIn, +AOut, -BOut] extends AnyRef

    IsMono is a type-constraint that is used by the middleware api for allowing some operators only when the following condition is met.

    IsMono is a type-constraint that is used by the middleware api for allowing some operators only when the following condition is met.

    Condition: Since a middleware takes in an Http and returns a new Http, IsMono, makes sure that the type parameters of the incoming Http and the ones for the outgoing Http is the same.

    For Eg: IsMono will be defined for a middleware that looks as follows val mid: Middleware[Any, Nothing, Request, Response, Request, Response]

    This is because both the middleware is defined from (Request, Response) => (Request, Response). Consider another example:

    val mid: Middleware[Any, Nothing, Request, Response, UserRequest, UserResponse]

    In this case, the incoming and outgoing types are different viz. (Request, Response) => (UserRequest, UserResponse), hence there is no IsMono defined for such middlewares.

    Annotations
    @implicitNotFound( ... )
  9. final case class MediaType(mainType: String, subType: String, compressible: Boolean = false, binary: Boolean = false, fileExtensions: List[String] = Nil, extensions: Map[String, String] = Map.empty) extends Product with Serializable
  10. sealed trait Method extends AnyRef
  11. trait Middleware[-R, +E, +AIn, -BIn, -AOut, +BOut] extends AnyRef

    Middlewares are essentially transformations that one can apply on any Http to produce a new one.

    Middlewares are essentially transformations that one can apply on any Http to produce a new one. They can modify requests and responses and also transform them into more concrete domain entities.

    You can think of middlewares as a functions —

    type Middleware[R, E, AIn, BIn, AOut, BOut] = Http[R, E, AIn, BIn] => Http[R, E, AOut, BOut]

    The AIn and BIn type params represent the type params of the input Http. The AOut and BOut type params represent the type params of the output Http.

  12. sealed trait Patch extends AnyRef

    Models the set of operations that one would want to apply on a Response.

  13. final case class Path extends Product with Serializable

    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.

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

  15. type RHttpApp[-R] = Http[R, Throwable, Request, Response]
  16. trait Request extends HeaderExtension[Request] with HttpDataExtension[Request]
  17. final case class Response extends HeaderExtension[Response] with HttpDataExtension[Response] with Product with Serializable
  18. type ResponseZIO[-R, +E] = ZIO[R, E, Response]
  19. 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 -> !! / "user" / int(id) => Response.text("User id requested: ${id}") case GET -> !! / "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 the id param can be decoded into an Int. If a request of the form GET /user/zio is made, in that case the second case is matched.

  20. abstract class RouteDecode[A] extends AnyRef
    Definition Classes
    RouteDecoderModule
  21. sealed trait Scheme extends AnyRef
  22. sealed trait Status extends Product with Serializable
  23. type UHttp[-A, +B] = Http[Any, Nothing, A, B]
  24. type UHttpApp = Http[Any, Nothing, Request, Response]
  25. type UMiddleware[+AIn, -BIn, -AOut, +BOut] = Middleware[Any, Nothing, AIn, BIn, AOut, BOut]
  26. final case class URL(path: Path, kind: Location = URL.Location.Relative, queryParams: Map[String, List[String]] = Map.empty, fragment: Option[Fragment] = None) extends Product with Serializable
  27. sealed trait Version extends AnyRef

Value Members

  1. val !!: Path
    Definition Classes
    PathSyntax
  2. val HTTP_CHARSET: Charset

    Default HTTP Charset

  3. val ~~: Path
    Definition Classes
    PathSyntax
  4. object ->
    Definition Classes
    RequestSyntax
  5. object /
    Definition Classes
    PathSyntax
  6. object /:
    Definition Classes
    PathSyntax
  7. object Cookie extends Serializable
  8. object HExit
  9. object HeaderNames extends HeaderNames
  10. object HeaderValues extends HeaderValues
  11. object Headers extends HeaderConstructors with Serializable
  12. object Http
  13. object HttpData
  14. object HttpError extends Serializable
  15. object IsMono extends IsMono[Any, Nothing, Nothing, Any]
  16. object MediaType extends MimeDB with Serializable
  17. object Method
  18. object Middleware extends Web
  19. object Patch
  20. object Path extends Serializable
  21. object Proxy extends Serializable
  22. object Request
  23. object Response extends Serializable
  24. object boolean extends RouteDecode[Boolean]
    Definition Classes
    RouteDecoderModule
  25. object byte extends RouteDecode[Byte]
    Definition Classes
    RouteDecoderModule
  26. object date extends RouteDecode[LocalDate]
    Definition Classes
    RouteDecoderModule
  27. object double extends RouteDecode[Double]
    Definition Classes
    RouteDecoderModule
  28. object float extends RouteDecode[Float]
    Definition Classes
    RouteDecoderModule
  29. object int extends RouteDecode[Int]
    Definition Classes
    RouteDecoderModule
  30. object long extends RouteDecode[Long]
    Definition Classes
    RouteDecoderModule
  31. object short extends RouteDecode[Short]
    Definition Classes
    RouteDecoderModule
  32. object time extends RouteDecode[LocalDateTime]
    Definition Classes
    RouteDecoderModule
  33. object uuid extends RouteDecode[UUID]
    Definition Classes
    RouteDecoderModule
  34. object Scheme
  35. object Status extends Serializable
  36. object URL extends Serializable
  37. object Version

Inherited from RouteDecoderModule

Inherited from RequestSyntax

Inherited from PathSyntax

Inherited from AnyRef

Inherited from Any

Ungrouped