Class

io.youi.client

HttpClient

Related Doc: package client

Permalink

class HttpClient extends AnyRef

Asynchronous HttpClient for simple request response support.

Adds support for simple restful request/response JSON support.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpClient
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new HttpClient(saveDirectory: File = ..., dropNullKeys: Boolean = false)

    Permalink

    saveDirectory

    the directory to save response content of a non-textual type

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  5. def call[Response](url: URL, method: Method = Method.Get, headers: Headers = Headers.empty, errorHandler: ErrorHandler[Response] = defaultErrorHandler[Response])(implicit decoder: Decoder[Response]): Future[Response]

    Permalink

    Builds on the send method by supporting basic restful calls that calls a URL and returns a case class as the response.

    Builds on the send method by supporting basic restful calls that calls a URL and returns a case class as the response.

    Response

    the response type

    url

    the URL of the endpoint

    headers

    the headers if any to provide

    errorHandler

    error handling support if the response status is not Success

    decoder

    circe decoding of the Response

    returns

    Future[Response]

  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def defaultErrorHandler[Response]: ErrorHandler[Response]

    Permalink

    Default error handler for restful bad response statuses.

    Default error handler for restful bad response statuses.

    Response

    the type of response

    returns

    throws a RuntimeException when an error occurs

    Attributes
    protected
  8. def dispose(): Unit

    Permalink

    Disposes and cleans up this client instance.

  9. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  13. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  14. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  15. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  16. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  17. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  18. def restful[Request, Response](url: URL, request: Request, headers: Headers = Headers.empty, errorHandler: ErrorHandler[Response] = defaultErrorHandler[Response], method: Method = Method.Post, processor: (Json) ⇒ Json = (json: Json) => json)(implicit encoder: Encoder[Request], decoder: Decoder[Response]): Future[Response]

    Permalink

    Builds on the send method by supporting basic restful calls that take a case class as the request and returns a case class as the response.

    Builds on the send method by supporting basic restful calls that take a case class as the request and returns a case class as the response.

    Request

    the request type

    Response

    the response type

    url

    the URL of the endpoint

    request

    the request instance

    headers

    the headers if any to provide

    errorHandler

    error handling support if the response status is not Success

    encoder

    circe encoding of the Request

    decoder

    circe decoding of the Response

    returns

    Future[Response]

  19. def send(request: HttpRequest): Future[HttpResponse]

    Permalink

    Sends an HttpRequest and receives an asynchronous HttpResponse future.

    Sends an HttpRequest and receives an asynchronous HttpResponse future.

    request

    the request to send

    returns

    Future[HttpResponse]

  20. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  21. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  22. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  24. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from AnyRef

Inherited from Any

Ungrouped