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.

Self Type
Http[R, E, A, B]
Linear Supertypes
(A) ⇒ ZIO[R, Option[E], B], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Http
  2. Function1
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def *>[R1 <: R, E1 >: E, A1 <: A, C1](other: Http[R1, E1, A1, C1]): Http[R1, E1, A1, C1]

    Alias for zipRight

  4. final def ++[R1 <: R, E1 >: E, A1 <: A, B1 >: B](other: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Combines two Http into one.

  5. final def <<<[R1 <: R, E1 >: E, A1 <: A, X](other: Http[R1, E1, X, A1]): Http[R1, E1, X, B]

    Composes one Http app with another.

  6. final def <>[R1 <: R, E1, A1 <: A, B1 >: B](other: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Runs self but if it fails, runs other, ignoring the result from self.

  7. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  8. final def >>=[R1 <: R, E1 >: E, A1 <: A, C1](f: (B) ⇒ Http[R1, E1, A1, C1]): Http[R1, E1, A1, C1]

    Alias for flatmap

  9. final def >>>[R1 <: R, E1 >: E, B1 >: B, C](other: Http[R1, E1, B1, C]): Http[R1, E1, A, C]

    Pipes the output of one app into the other

  10. final def @@[R1 <: R, E1 >: E, A1 <: A, B1 >: B, A2, B2](mid: Middleware[R1, E1, A1, B1, A2, B2]): Http[R1, E1, A2, B2]

    Attaches the provided middleware to the Http app

  11. final def \/[R1 <: R, E1 >: E, C, D](other: Http[R1, E1, C, D]): Middleware[R1, E1, B, C, A, D]

    Combines two Http instances into a middleware that works a codec for incoming and outgoing messages.

  12. final def absolve[E1 >: E, C](implicit ev: <:<[B, Either[E1, C]]): Http[R, E1, A, C]

    Returns an http app that submerges the error case of an Either into the Http.

    Returns an http app that submerges the error case of an Either into the Http. The inverse operation of Http.either.

  13. final def andThen[R1 <: R, E1 >: E, B1 >: B, C](other: Http[R1, E1, B1, C]): Http[R1, E1, A, C]

    Named alias for >>>

  14. def andThen[A](g: (ZIO[R, Option[E], B]) ⇒ A): (A) ⇒ A
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  15. final def apply(a: A): ZIO[R, Option[E], B]

    Consumes the input and executes the Http.

    Consumes the input and executes the Http.

    Definition Classes
    Http → Function1
  16. final def as[C](c: C): Http[R, E, A, C]

    Makes the app resolve with a constant value

  17. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  18. final def body(implicit eb: <:<[B, Response], ee: <:<[E, Throwable]): Http[R, Throwable, A, Chunk[Byte]]

    Extracts body

  19. final def bodyAsString(implicit eb: <:<[B, Response], ee: <:<[E, Throwable]): Http[R, Throwable, A, String]

    Extracts body as a string

  20. final def catchAll[R1 <: R, E1, A1 <: A, B1 >: B](f: (E) ⇒ Http[R1, E1, A1, B1])(implicit ev: CanFail[E]): Http[R1, E1, A1, B1]

    Catches all the exceptions that the http app can fail with

  21. final def catchAllDefect[R2 <: R, E2 >: E, A2 <: A, B2 >: B](h: (Throwable) ⇒ Http[R2, E2, A2, B2]): Http[R2, E2, A2, B2]

    Recovers from all defects with provided function.

    Recovers from all defects with provided function.

    WARNING: There is no sensible way to recover from defects. This method should be used only at the boundary between Http and an external system, to transmit information on a defect for diagnostic or explanatory purposes.

  22. final def catchNonFatalOrDie[R2 <: R, E2 >: E, A2 <: A, B2 >: B](h: (E) ⇒ Http[R2, E2, A2, B2])(implicit ev1: CanFail[E], ev2: <:<[E, Throwable]): Http[R2, E2, A2, B2]

    Recovers from all NonFatal Throwables.

  23. final def catchSome[R1 <: R, E1 >: E, A1 <: A, B1 >: B](f: PartialFunction[E, Http[R1, E1, A1, B1]])(implicit ev: CanFail[E]): Http[R1, E1, A1, B1]

    Recovers from some or all of the error cases.

  24. final def catchSomeDefect[R1 <: R, E1 >: E, A1 <: A, B1 >: B](pf: PartialFunction[Throwable, Http[R1, E1, A1, B1]]): Http[R1, E1, A1, B1]

    Recovers from some or all of the defects with provided partial function.

    Recovers from some or all of the defects with provided partial function.

    WARNING: There is no sensible way to recover from defects. This method should be used only at the boundary between Http and an external system, to transmit information on a defect for diagnostic or explanatory purposes.

  25. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  26. final def codecMiddleware[R1 <: R, E1 >: E, C, D](other: Http[R1, E1, C, D]): Middleware[R1, E1, B, C, A, D]

    Combines two Http instances into a middleware that works a codec for incoming and outgoing messages.

  27. final def collect[B1 >: B, C](pf: PartialFunction[B1, C]): Http[R, E, A, C]

    Collects some of the results of the http and converts it to another type.

  28. final def collectZIO[R1 <: R, E1 >: E, A1 <: A, B1 >: B, C](pf: PartialFunction[B1, ZIO[R1, E1, C]]): Http[R1, E1, A1, C]

    Collects some of the results of the http and effectfully converts it to another type.

  29. final def compose[R1 <: R, E1 >: E, A1 <: A, C1](other: Http[R1, E1, C1, A1]): Http[R1, E1, C1, B]

    Named alias for <<<

  30. def compose[A](g: (A) ⇒ A): (A) ⇒ ZIO[R, Option[E], B]
    Definition Classes
    Function1
    Annotations
    @unspecialized()
  31. final def contentLength(implicit eb: <:<[B, Response]): Http[R, E, A, Option[Long]]

    Extracts content-length from the response if available

  32. final def contentType(implicit eb: <:<[B, Response]): Http[R, E, A, Option[CharSequence]]

    Extracts the value of ContentType header

  33. final def contraCollect[X](pf: PartialFunction[X, A]): Http[R, E, X, B]

    Like collect but is applied on the incoming type A.

  34. final def contraFlatMap[X]: PartialContraFlatMap[R, E, A, B, X]

    Transforms the input of the http before passing it on to the current Http

  35. final def contramap[X](xa: (X) ⇒ A): Http[R, E, X, B]

    Transforms the input of the http before passing it on to the current Http

  36. final def contramapZIO[R1 <: R, E1 >: E, X](xa: (X) ⇒ ZIO[R1, E1, A]): Http[R1, E1, X, B]

    Transforms the input of the http before giving it effectfully

  37. final def defaultWith[R1 <: R, E1 >: E, A1 <: A, B1 >: B](other: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Named alias for ++

  38. final def delay(duration: zio.Duration): Http[R, E, A, B]

    Delays production of output B for the specified duration of time

  39. final def delayAfter(duration: zio.Duration): Http[R, E, A, B]

    Delays production of output B for the specified duration of time

  40. final def delayBefore(duration: zio.Duration): Http[R, E, A, B]

    Delays consumption of input A for the specified duration of time

  41. final def either(implicit ev: CanFail[E]): Http[R, Nothing, A, Either[E, B]]

    Returns an http app whose failure and success have been lifted into an Either.

    Returns an http app whose failure and success have been lifted into an Either. The resulting app cannot fail, because the failure case has been exposed as part of the Either success case.

  42. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  43. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  44. final def flatMap[R1 <: R, E1 >: E, A1 <: A, C1](f: (B) ⇒ Http[R1, E1, A1, C1]): Http[R1, E1, A1, C1]

    Creates a new Http app from another

  45. final def flatten[R1 <: R, E1 >: E, A1 <: A, B1](implicit ev: <:<[B, Http[R1, E1, A1, B1]]): Http[R1, E1, A1, B1]

    Flattens an Http app of an Http app

  46. final def foldHttp[R1 <: R, A1 <: A, E1, B1](failure: (E) ⇒ Http[R1, E1, A1, B1], defect: (Throwable) ⇒ Http[R1, E1, A1, B1], success: (B) ⇒ Http[R1, E1, A1, B1], empty: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Folds over the http app by taking in two functions one for success and one for failure respectively.

  47. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  48. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  49. final def headerValue(name: CharSequence)(implicit eb: <:<[B, Response]): Http[R, E, A, Option[CharSequence]]

    Extracts the value of the provided header name.

  50. final def headers(implicit eb: <:<[B, Response]): Http[R, E, A, Headers]

    Extracts the Headers from the type B if possible

  51. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  52. final def map[C](bc: (B) ⇒ C): Http[R, E, A, C]

    Transforms the output of the http app

  53. final def mapError[E1](ee: (E) ⇒ E1): Http[R, E1, A, B]

    Transforms the failure of the http app

  54. final def mapZIO[R1 <: R, E1 >: E, C](bFc: (B) ⇒ ZIO[R1, E1, C]): Http[R1, E1, A, C]

    Transforms the output of the http effectfully

  55. final def merge[E1 >: E, B1 >: B](implicit ev: =:=[E1, B1]): Http[R, Nothing, A, B1]

    Returns a new Http where the error channel has been merged into the success channel to their common combined type.

  56. final def middleware[R1 <: R, E1 >: E, A1 <: A, B1 >: B, A2, B2](mid: Middleware[R1, E1, A1, B1, A2, B2]): Http[R1, E1, A2, B2]

    Named alias for @@

  57. final def narrow[A1](implicit a: <:<[A1, A]): Http[R, E, A1, B]

    Narrows the type of the input

  58. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  59. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  60. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  61. final def option(implicit ev: CanFail[E]): Http[R, Nothing, A, Option[B]]

    Executes this app, skipping the error but returning optionally the success.

  62. final def optional[E1](implicit ev: <:<[E, Option[E1]]): Http[R, E1, A, Option[B]]

    Converts an option on errors into an option on values.

  63. final def orDie(implicit ev1: <:<[E, Throwable], ev2: CanFail[E]): Http[R, Nothing, A, B]

    Translates app failure into death of the app, making all failures unchecked and not a part of the type of the app.

  64. final def orDieWith(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): Http[R, Nothing, A, B]

    Keeps none of the errors, and terminates the http app with them, using the specified function to convert the E into a Throwable.

  65. final def orElse[R1 <: R, E1, A1 <: A, B1 >: B](other: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Named alias for <>

  66. final def provideEnvironment(r: ZEnvironment[R]): Http[Any, E, A, B]

    Provides the environment to Http.

  67. final def provideLayer[E1 >: E, R0](layer: ZLayer[R0, E1, R]): Http[R0, E1, A, B]

    Provides layer to Http.

  68. final def provideSomeEnvironment[R1](r: (ZEnvironment[R1]) ⇒ ZEnvironment[R]): Http[R1, E, A, B]

    Provides some of the environment to Http.

  69. final def provideSomeLayer[R0, R1, E1 >: E](layer: ZLayer[R0, E1, R1])(implicit ev: <:<[R0 with R1, R], tagged: Tag[R1]): Http[R0, E1, A, B]

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

  70. final def race[R1 <: R, E1 >: E, A1 <: A, B1 >: B](other: Http[R1, E1, A1, B1]): Http[R1, E1, A1, B1]

    Performs a race between two apps

  71. final def refineOrDie[E1](pf: PartialFunction[E, E1])(implicit ev1: <:<[E, Throwable], ev2: CanFail[E]): Http[R, E1, A, B]

    Keeps some of the errors, and terminates the http app with the rest.

  72. final def refineOrDieWith[E1](pf: PartialFunction[E, E1])(f: (E) ⇒ Throwable)(implicit ev: CanFail[E]): Http[R, E1, A, B]

    Keeps some of the errors, and terminates the http app with the rest, using the specified function to convert the E into a Throwable.

  73. final def status(implicit ev: <:<[B, Response]): Http[R, E, A, Status]

    Extracts Status from the type B is possible.

  74. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  75. final def tap[R1 <: R, E1 >: E, A1 <: A](f: (B) ⇒ Http[R1, E1, Any, Any]): Http[R1, E1, A, B]

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

  76. final def tapAll[R1 <: R, E1 >: E](failure: (E) ⇒ Http[R1, E1, Any, Any], defect: (Throwable) ⇒ Http[R1, E1, Any, Any], success: (B) ⇒ Http[R1, E1, Any, Any], empty: Http[R1, E1, Any, Any]): Http[R1, E1, A, B]

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

  77. final def tapAllZIO[R1 <: R, E1 >: E](failure: (E) ⇒ ZIO[R1, E1, Any], defect: (Throwable) ⇒ ZIO[R1, E1, Any], success: (B) ⇒ ZIO[R1, E1, Any], empty: ZIO[R1, E1, Any]): Http[R1, E1, A, B]

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

  78. final def tapError[R1 <: R, E1 >: E](f: (E) ⇒ Http[R1, E1, Any, Any]): Http[R1, E1, A, B]

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

  79. final def tapErrorZIO[R1 <: R, E1 >: E](f: (E) ⇒ ZIO[R1, E1, Any]): Http[R1, E1, A, B]

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

  80. final def tapZIO[R1 <: R, E1 >: E](f: (B) ⇒ ZIO[R1, E1, Any]): Http[R1, E1, A, B]

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

  81. final def toSocketApp(implicit a: <:<[WebSocketChannelEvent, A], e: <:<[E, Throwable]): SocketApp[R]

    Converts an Http into a websocket application

  82. def toString(): String
    Definition Classes
    Function1 → AnyRef → Any
  83. final def unrefine[E1 >: E](pf: PartialFunction[Throwable, E1]): Http[R, E1, A, B]

    Takes some defects and converts them into failures.

  84. final def unrefineTo[E1 >: E](implicit arg0: ClassTag[E1]): Http[R, E1, A, B]

    Takes some defects and converts them into failures.

  85. final def unrefineWith[E1](pf: PartialFunction[Throwable, E1])(f: (E) ⇒ E1): Http[R, E1, A, B]

    Takes some defects and converts them into failures, using the specified function to convert the E into an E1.

  86. final def unwrap[R1 <: R, E1 >: E, C](implicit ev: <:<[B, ZIO[R1, E1, C]]): Http[R1, E1, A, C]

    Unwraps an Http that returns a ZIO of Http

  87. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  88. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  89. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  90. final def when[A2 <: A](f: (A2) ⇒ Boolean): Http[R, E, A2, B]

    Applies Http based only if the condition function evaluates to true

  91. final def widen[E1, B1](implicit e: <:<[E, E1], b: <:<[B, B1]): Http[R, E1, A, B1]

    Widens the type of the output

  92. final def zipRight[R1 <: R, E1 >: E, A1 <: A, C1](other: Http[R1, E1, A1, C1]): Http[R1, E1, A1, C1]

    Combines the two apps and returns the result of the one on the right

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated

Inherited from (A) ⇒ ZIO[R, Option[E], B]

Inherited from AnyRef

Inherited from Any

Ungrouped