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, defaultInterceptor: Interceptor = Interceptor.empty, pingInterval: Option[FiniteDuration] = None, connectionPool: ConnectionPool = ConnectionPool.default, dns: DNS = DNS.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, defaultInterceptor: Interceptor = Interceptor.empty, pingInterval: Option[FiniteDuration] = None, connectionPool: ConnectionPool = ConnectionPool.default, dns: DNS = DNS.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, interceptor: Interceptor = defaultInterceptor)(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 defaultInterceptor: Interceptor

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  14. val defaultRetries: Int

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  15. val defaultRetryDelay: FiniteDuration

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  16. val dns: DNS

    Permalink
    Definition Classes
    JVMHttpClientHttpClient
  17. def dropNullValues: Boolean

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  21. def implementation(request: HttpRequest): Future[HttpResponse]

    Permalink
    Attributes
    protected
    Definition Classes
    JVMHttpClientHttpClient
  22. final def isInstanceOf[T0]: Boolean

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

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

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

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

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

    Permalink
  28. lazy val printer: Printer

    Permalink
    Attributes
    protected
    Definition Classes
    HttpClient
  29. 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, interceptor: Interceptor = defaultInterceptor)(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
  30. val saveDirectory: File

    Permalink

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

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

    interceptor

    specifies an interceptor to work with requests and responses. Defaults to Interceptor.empty.

    returns

    Future[HttpResponse]

    Definition Classes
    HttpClient
  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  33. val timeout: FiniteDuration

    Permalink
  34. final def wait(): Unit

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. 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