final case class Client[F[_]](open: Kleisli[F, HttpRequest[F], DisposableResponse[F]], dispose: F[Unit])(implicit F: MonadError[F, Throwable]) extends Product with Serializable

A thin layer over a HTTP service that adds implcit convenience for finding response decoders and handling unsuccessful (non 200 range) responses. Based on http4s design. The methods in this class do not deal with exceptions/errors but does, when expecting a successful result, translate a non-200 saus to an UnexpectedStatus exception and hence uses MonadError.raiseError to signal the error.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Client
  2. Serializable
  3. Serializable
  4. Product
  5. Equals
  6. AnyRef
  7. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Client(open: Kleisli[F, HttpRequest[F], DisposableResponse[F]], dispose: F[Unit])(implicit F: MonadError[F, Throwable])

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  6. val dispose: F[Unit]
  7. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  8. def expect[A](req: F[HttpRequest[F]])(implicit d: EntityDecoder[F, A]): F[A]

    Same as expect but request is in an effect.

  9. def expect[A](req: HttpRequest[F])(implicit d: EntityDecoder[F, A]): F[A]

    Fetch response, process response with d but only if successful status.

    Fetch response, process response with d but only if successful status. Throw UnexpectedStatus otherwise since you cannot use the decoder, which assumes a successful response, if the response is not valid.

  10. def fetch[A](request: F[HttpRequest[F]])(f: (HttpResponse[F]) ⇒ F[A]): F[A]

    Same as fetch but request is in an effect.

  11. def fetch[A](request: HttpRequest[F])(f: (HttpResponse[F]) ⇒ F[A]): F[A]

    Fetch response, process regardless of status.

    Fetch response, process regardless of status. Very low-level.

  12. def fetchAs[A](req: HttpRequest[F])(implicit d: EntityDecoder[F, A]): F[A]

    Fetch response, process response with d regardless of status.

    Fetch response, process response with d regardless of status. Hence your d needs to be very general. Throws any exception found in d's returned value, DecodeResult.

  13. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  15. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  16. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  17. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  18. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  19. val open: Kleisli[F, HttpRequest[F], DisposableResponse[F]]
  20. def shutdown(): F[Unit]
  21. def status(req: F[HttpRequest[F]]): F[Status]

    Conveience.

  22. def status(req: HttpRequest[F]): F[Status]

    Return only the status.

  23. def streaming[A](req: HttpRequest[F])(f: (HttpResponse[F]) ⇒ Stream[F, A]): Stream[F, A]

    Stream the response contents.

  24. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  25. def toService[A](f: (HttpResponse[F]) ⇒ F[A]): Kleisli[F, HttpRequest[F], A]

    Creates a funcion that acts like "client.fetch" but without need to call .fetch.

  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from AnyRef

Inherited from Any

Ungrouped