Packages

trait HttpClient[F[_]] extends AnyRef

Source
HttpClient.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. HttpClient
  2. AnyRef
  3. Any
Implicitly
  1. by any2stringadd
  2. by StringFormat
  3. by Ensuring
  4. by ArrowAssoc
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def request(request: HttpRequest[F], maxResponseHeaderSize: Int = 4096, timeout: Duration = 5.seconds): Resource[F, HttpResponse[F]]

    Performs a single request.

    Performs a single request. Returns a Resource that provides one response if client replied.

    Note that request may contain stream of bytes that shall be sent to client. The response from server is evaluated _after_ client sent all data, including the body to the server.

    The Resource ensures proper cleanup of the underlying connection. The response body stream remains available during the Resource's lifetime. Typical usage: request(thatRequest).use { response => response.body.through(bodyProcessor).compile.drain }

    This methods allows to be supplied with timeout (default is 5s) that the request awaits to be completed before failure.

    Timeout is computed once the requests was sent and includes also the time for processing the response header but not the body.

    Resulting Resource fails with TimeoutException if the timeout is triggered

    request

    Request to make to server

    timeout

    Request will fail if response header is not received within supplied timeout Note that this is timeout just for the header, the body is available as stream and may be processed at leisure. Also timeout applies after the request was sent, so if the request body is a stream that does not end, the timeout will not be applied.

  2. abstract def sse[A](request: HttpRequest[F], maxResponseHeaderSize: Int = 4096)(implicit arg0: SSEDecoder[A]): Stream[F, A]

    Reads SSE encoded stream of data from the server.

    Reads SSE encoded stream of data from the server.

    request

    Request to server. Note that this must be GET request.

    maxResponseHeaderSize

    Max size of expected response header

  3. abstract def websocket[I, O](request: WebSocketRequest, handshakeTimeout: FiniteDuration, maxResponseHeaderSize: Int = 4096, maxFrameSize: Int = 1024*1024)(onConnect: (HttpResponseHeader) ⇒ Pipe[F, Frame[I], Frame[O]])(implicit arg0: Decoder[I], arg1: Encoder[O]): Stream[F, Option[HttpResponseHeader]]

    Establishes websocket connection to the server.

    Establishes websocket connection to the server.

    Implementation is according to RFC-6455 (https://tools.ietf.org/html/rfc6455).

    If this is established successfully, then this consults pipe to receive/sent any frames From/To server. Once the connection finishes, this will emit once None.

    If the connection was not established correctly (i.e. Authorization failure) this will not consult supplied pipe and instead this will immediately emit response received from the server.

    request

    WebSocket request

    handshakeTimeout

    Timeout to handshake initial websocket protocol before starting to exchange any data

    maxResponseHeaderSize

    Max size of Http Response header received

    maxFrameSize

    Maximum size of single WebSocket frame. If the binary size of single frame is larger than supplied value, WebSocket will fail.

    onConnect

    Function to evaluate to pipe when successfully connected.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to any2stringadd[HttpClient[F]] performed by method any2stringadd in scala.Predef.
    Definition Classes
    any2stringadd
  4. def ->[B](y: B): (HttpClient[F], B)
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to ArrowAssoc[HttpClient[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc
    Annotations
    @inline()
  5. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  6. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  7. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native() @HotSpotIntrinsicCandidate()
  8. def ensuring(cond: (HttpClient[F]) ⇒ Boolean, msg: ⇒ Any): HttpClient[F]
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to Ensuring[HttpClient[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  9. def ensuring(cond: (HttpClient[F]) ⇒ Boolean): HttpClient[F]
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to Ensuring[HttpClient[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  10. def ensuring(cond: Boolean, msg: ⇒ Any): HttpClient[F]
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to Ensuring[HttpClient[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  11. def ensuring(cond: Boolean): HttpClient[F]
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to Ensuring[HttpClient[F]] performed by method Ensuring in scala.Predef.
    Definition Classes
    Ensuring
  12. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  16. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  17. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  18. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  19. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @HotSpotIntrinsicCandidate()
  20. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  21. def toString(): String
    Definition Classes
    AnyRef → Any
  22. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  23. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... ) @native()
  24. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. def [B](y: B): (HttpClient[F], B)
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to ArrowAssoc[HttpClient[F]] performed by method ArrowAssoc in scala.Predef.
    Definition Classes
    ArrowAssoc

Deprecated Value Members

  1. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] ) @Deprecated
    Deprecated
  2. def formatted(fmtstr: String): String
    Implicit
    This member is added by an implicit conversion from HttpClient[F] to StringFormat[HttpClient[F]] performed by method StringFormat in scala.Predef.
    Definition Classes
    StringFormat
    Annotations
    @deprecated @inline()
    Deprecated

    (Since version 2.12.16) Use formatString.format(value) instead of value.formatted(formatString), or use the f"" string interpolator. In Java 15 and later, formatted resolves to the new method in String which has reversed parameters.

Inherited from AnyRef

Inherited from Any

Inherited by implicit conversion any2stringadd from HttpClient[F] to any2stringadd[HttpClient[F]]

Inherited by implicit conversion StringFormat from HttpClient[F] to StringFormat[HttpClient[F]]

Inherited by implicit conversion Ensuring from HttpClient[F] to Ensuring[HttpClient[F]]

Inherited by implicit conversion ArrowAssoc from HttpClient[F] to ArrowAssoc[HttpClient[F]]

Ungrouped