Http

org.http4s.Http
object Http

Functions for creating Http kleislis.

Attributes

Source
Http.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Self type
Http.type

Members list

Value members

Concrete methods

def apply[F[_], G[_]](run: Request[G] => F[Response[G]])(implicit F: Monad[F]): Http[F, G]

Lifts a function into an Http kleisli.

Lifts a function into an Http kleisli. The application of run is suspended in F to permit more efficient combination of routes via SemigroupK.

Type parameters

F

the effect of the Response returned by the Http

G

the effect of the bodies of the Request and Response

Value parameters

run

the function to lift

Attributes

Returns

an Http that suspends run.

Source
Http.scala
def liftF[F[_], G[_]](fr: F[Response[G]]): Http[F, G]

Lifts an effectful Response into an Http kleisli.

Lifts an effectful Response into an Http kleisli.

Type parameters

F

the effect of the Response returned by the Http

G

the effect of the bodies of the Request and Response

Value parameters

fr

the effectful Response to lift

Attributes

Returns

an Http that always returns fr

Source
Http.scala
def local[F[_], G[_]](f: Request[G] => Request[G])(fa: Http[F, G])(implicit F: Monad[F]): Http[F, G]

Transforms an Http on its input.

Transforms an Http on its input. The application of the transformed function is suspended in F to permit more efficient combination of routes via SemigroupK.

Type parameters

F

the effect of the Response returned by the Http

G

the effect of the bodies of the Request and Response

Value parameters

f

a function to apply to the Request

fa

the Http to transform

Attributes

Returns

An Http whose input is transformed by f before being applied to fa

Source
Http.scala
def pure[F[_] : Applicative, G[_]](r: Response[G]): Http[F, G]

Lifts a Response into an Http kleisli.

Lifts a Response into an Http kleisli.

Type parameters

F

the effect of the Response returned by the Http

G

the effect of the bodies of the Request and Response

Value parameters

r

the Response to lift

Attributes

Returns

an Http that always returns r in effect F

Source
Http.scala