Http4sClientInterpreter

abstract class Http4sClientInterpreter[F[_]]
Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def toRequest[I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[String]): I => (Request[F], Response[F] => F[DecodeResult[Either[E, O]]])

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The results of the function are:

  • an org.http4s.Request[F], which can be sent using an http4s client, or run against org.http4s.HttpRoutes[F];
  • a response parser that extracts the expected entity from the received org.http4s.Response[F].
def toRequestUnsafe[I, E, O, R](e: Endpoint[I, E, O, R], baseUri: Option[String]): I => (Request[F], Response[F] => F[Either[E, O]])

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Interprets the endpoint as a client call, using the given baseUri as the starting point to create the target uri. If baseUri is not provided, the request will be a relative one.

Returns a function which, when applied to the endpoint's input parameters (given as a tuple), will encode them to appropriate request parameters: path, query, headers and body. The results of the function are:

  • an org.http4s.Request[F], which can be sent using an http4s client, or run against org.http4s.HttpRoutes[F];
  • a response parser that extracts the expected entity from the received org.http4s.Response[F].