Http

zio.http.Http
See theHttp companion object
sealed trait Http[-R, +Err, -In, +Out]

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object Empty.type
trait Route[R, Err, In, Out]
class Static[R, Err, In, Out]
Self type
Http[R, Err, In, Out]

Members list

Concise view

Value members

Concrete methods

final def ++[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](that: Http[R1, Err1, In1, Out1])(implicit trace: Trace): Http[R1, Err1, In1, Out1]

Combines two Http into one.

Combines two Http into one.

Attributes

final def >>>[R1 <: R, Err1 >: Err, In1 >: Out, Out1](handler: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Http[R1, Err1, In, Out1]

Pipes the output of one app into the other

Pipes the output of one app into the other

Attributes

final def @@[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out, In2, Out2](aspect: Middleware[R1, Err1, In1, Out1, In2, Out2])(implicit trace: Trace): Http[R1, Err1, In2, Out2]
def body(implicit trace: Trace): Http[R, Err, In, Body]
Implicitly added by ResponseOutputSyntax
def contentLength(implicit trace: Trace): Http[R, Err, In, Option[Long]]
Implicitly added by ResponseOutputSyntax
def contentType(implicit trace: Trace): Http[R, Err, In, Option[String]]
Implicitly added by ResponseOutputSyntax
final def defaultWith[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](that: Http[R1, Err1, In1, Out1])(implicit trace: Trace): Http[R1, Err1, In1, Out1]

Named alias for ++

Named alias for ++

Attributes

def headerValue(name: CharSequence)(implicit trace: Trace): Http[R, Err, In, Option[String]]
Implicitly added by ResponseOutputSyntax
def headers(implicit trace: Trace): Http[R, Err, In, Headers]
Implicitly added by ResponseOutputSyntax
final def map[Out1](f: Out => Out1)(implicit trace: Trace): Http[R, Err, In, Out1]

Transforms the output of the http app

Transforms the output of the http app

Attributes

final def mapError[Err1](f: Err => Err1)(implicit trace: Trace): Http[R, Err1, In, Out]

Transforms the failure of the http app

Transforms the failure of the http app

Attributes

final def mapZIO[R1 <: R, Err1 >: Err, Out1](f: Out => ZIO[R1, Err1, Out1])(implicit trace: Trace): Http[R1, Err1, In, Out1]

Transforms the output of the http effectfully

Transforms the output of the http effectfully

Attributes

final def provideEnvironment(r: ZEnvironment[R])(implicit trace: Trace): Http[Any, Err, In, Out]

Provides the environment to Http.

Provides the environment to Http.

Attributes

final def provideLayer[Err1 >: Err, R0](layer: ZLayer[R0, Err1, R])(implicit trace: Trace): Http[R0, Err1, In, Out]

Provides layer to Http.

Provides layer to Http.

Attributes

final def provideSomeEnvironment[R1](f: ZEnvironment[R1] => ZEnvironment[R])(implicit trace: Trace): Http[R1, Err, In, Out]

Provides some of the environment to Http.

Provides some of the environment to Http.

Attributes

final def provideSomeLayer[R0, R1 : Tag, Err1 >: Err](layer: ZLayer[R0, Err1, R1])(implicit evidence$1: Tag[R1], ev: R0 & R1 <:< R, trace: Trace): Http[R0, Err1, In, Out]

Provides some of the environment to Http leaving the remainder R0.

Provides some of the environment to Http leaving the remainder R0.

Attributes

final def runHandler(in: In)(implicit trace: Trace): ZIO[R, Err, Option[Handler[R, Err, In, Out]]]
final def runZIO(in: In)(implicit trace: Trace): ZIO[R, Option[Err], Out]
final def runZIOOrNull(in: In)(implicit unsafe: Unsafe, trace: Trace): ZIO[R, Err, Out]
def status(implicit trace: Trace): Http[R, Err, In, Status]
Implicitly added by ResponseOutputSyntax
final def tapAllZIO[R1 <: R, Err1 >: Err](onFailure: Cause[Err] => ZIO[R1, Err1, Any], onSuccess: Out => ZIO[R1, Err1, Any], onUnhandled: ZIO[R1, Err1, Any])(implicit trace: Trace): Http[R1, Err1, In, Out]

Returns an Http that effectfully peeks at the success, failed, defective or empty value of this Http.

Returns an Http that effectfully peeks at the success, failed, defective or empty value of this Http.

Attributes

final def tapErrorCauseZIO[R1 <: R, Err1 >: Err](f: Cause[Err] => ZIO[R1, Err1, Any])(implicit trace: Trace): Http[R1, Err1, In, Out]
final def tapErrorZIO[R1 <: R, Err1 >: Err](f: Err => ZIO[R1, Err1, Any])(implicit trace: Trace): Http[R1, Err1, In, Out]

Returns an Http that effectfully peeks at the failure of this Http.

Returns an Http that effectfully peeks at the failure of this Http.

Attributes

final def tapUnhandledZIO[R1 <: R, Err1 >: Err](f: ZIO[R1, Err1, Any])(implicit trace: Trace): Http[R1, Err1, In, Out]
final def tapZIO[R1 <: R, Err1 >: Err](f: Out => ZIO[R1, Err1, Any])(implicit trace: Trace): Http[R1, Err1, In, Out]

Returns an Http that effectfully peeks at the success of this Http.

Returns an Http that effectfully peeks at the success of this Http.

Attributes

final def toHandler[R1 <: R, Err1 >: Err, In1 <: In, Out1 >: Out](default: Handler[R1, Err1, In1, Out1])(implicit trace: Trace): Handler[R1, Err1, In1, Out1]
final def toSocketApp(implicit ev1: WebSocketChannelEvent <:< In, ev2: Err <:< Throwable, trace: Trace): SocketApp[R]

Converts an Http into a websocket application

Converts an Http into a websocket application

Attributes

final def when[In1 <: In](f: In1 => Boolean)(implicit trace: Trace): Http[R, Err, In1, Out]

Applies Http based only if the condition function evaluates to true

Applies Http based only if the condition function evaluates to true

Attributes

final def whenZIO[R1 <: R, Err1 >: Err, In1 <: In](f: In1 => ZIO[R1, Err1, Boolean])(implicit trace: Trace): Http[R1, Err1, In1, Out]
final def withDefaultErrorResponse(implicit trace: Trace, ev1: Request <:< In, ev2: Out <:< Response): App[R]
final def withMiddleware[R1 <: R, In1 <: In, In2, Out2](middleware: Middleware[R1, In2, Out2])(implicit ev1: In1 <:< Request, ev2: Out <:< Response): HttpApp[R1, Err]

Attaches the provided middleware to the Http app

Attaches the provided middleware to the Http app

Attributes

Concrete fields

val self: Http[R, Err, In, Response]
Implicitly added by ResponseOutputSyntax