Class/Object

io.youi.client

JVMHttpClient

Related Docs: object JVMHttpClient | package client

Permalink

case class JVMHttpClient(saveDirectory: File = ..., timeout: FiniteDuration = 15.seconds, defaultRetries: Int = 0, defaultRetryDelay: FiniteDuration = 5.seconds, pingInterval: Option[FiniteDuration] = None, connectionPool: ConnectionPool = ConnectionPool.default) extends HttpClient with Product with Serializable

Asynchronous HttpClient for simple request response support.

Adds support for simple restful request/response JSON support.

saveDirectory

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

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

Instance Constructors

  1. new JVMHttpClient(saveDirectory: File = ..., timeout: FiniteDuration = 15.seconds, defaultRetries: Int = 0, defaultRetryDelay: FiniteDuration = 5.seconds, pingInterval: Option[FiniteDuration] = None, connectionPool: ConnectionPool = ConnectionPool.default)

    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], retry: Int = defaultRetries, retryDelay: FiniteDuration = defaultRetryDelay)(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]

    Definition Classes
    HttpClient
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. val connectionPool: ConnectionPool

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  8. def content2Bytes(content: Content): Array[Byte]

    Permalink
    Attributes
    protected
  9. def content2String(content: Content): String

    Permalink
    Attributes
    protected
    Definition Classes
    JVMHttpClientHttpClient
  10. def contentToBytes(contentType: ContentType, contentLength: Option[Long]): Boolean

    Permalink
    Attributes
    protected
  11. def contentToString(contentType: ContentType, contentLength: Option[Long]): Boolean

    Permalink
    Attributes
    protected
  12. 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
    Definition Classes
    HttpClient
  13. val defaultRetries: Int

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  14. val defaultRetryDelay: FiniteDuration

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  15. def dropNullValues: Boolean

    Permalink
    Definition Classes
    HttpClient
  16. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  17. def finalize(): Unit

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

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

    Permalink
    Definition Classes
    Any
  20. def logStats(): Unit

    Permalink
  21. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  24. val pingInterval: Option[FiniteDuration]

    Permalink
  25. lazy val printer: Printer

    Permalink
    Attributes
    protected
    Definition Classes
    HttpClient
  26. 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, retry: Int = defaultRetries, retryDelay: FiniteDuration = defaultRetryDelay)(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]

    Definition Classes
    HttpClient
  27. val saveDirectory: File

    Permalink

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

  28. def send(request: HttpRequest, retry: Int = defaultRetries, retryDelay: FiniteDuration = defaultRetryDelay): 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

    retry

    the number of times to retry a failed request. This defaults to zero as most requests are not idempotent and calling multiple times can cause side-effects

    retryDelay

    if a failure occurs and a retry must occur, how long to wait until retrying. This defaults to 5.0 seconds

    returns

    Future[HttpResponse]

    Definition Classes
    JVMHttpClientHttpClient
  29. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  30. val timeout: FiniteDuration

    Permalink
  31. final def wait(): Unit

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

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

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

Inherited from Serializable

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from HttpClient

Inherited from AnyRef

Inherited from Any

Ungrouped