Trait/Object

spinoco.fs2.http

HttpClient

Related Docs: object HttpClient | package http

Permalink

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], chunkSize: Int = 32*1024, maxResponseHeaderSize: Int = 4096, timeout: Duration = 5.seconds): Stream[F, HttpResponse[F]]

    Permalink

    Performs a single request.

    Performs a single request. Returns 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.

    Note that the evaluation of body in HttpResponse may not outlive scope of resulting stream. That means only correct way to process the result is within the flatMap i.e. request(thatRequest).flatMap { response => response.body.through(bodyProcessor) }

    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 stream fails with TimeoutException if the timeout is triggered

    request

    Request to make to server

    chunkSize

    Size of the chunk to used when receiving response from server

    timeout

    Request will fail if response header and response body is not received within supplied timeout

  2. abstract def sse[A](request: HttpRequest[F], maxResponseHeaderSize: Int = 4096, chunkSize: Int = 32 * 1024)(implicit D: SSEDecoder[A]): Stream[F, A]

    Permalink

    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

    chunkSize

    Max size of the chunk

  3. abstract def websocket[I, O](request: WebSocketRequest, pipe: Pipe[F, Frame[I], Frame[O]], maxResponseHeaderSize: Int = 4096, chunkSize: Int = 32 * 1024, maxFrameSize: Int = 1024*1024)(implicit R: Decoder[I], W: Encoder[O], S: Scheduler): Stream[F, Option[HttpResponseHeader]]

    Permalink

    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

    pipe

    Pipe that is consulted when WebSocket is established correctly

    maxResponseHeaderSize

    Max size of Http Response header received

    chunkSize

    Size of receive buffer to use

    maxFrameSize

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

Concrete Value Members

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  3. def +(other: String): String

    Permalink
    Implicit information
    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)

    Permalink
    Implicit information
    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

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

    Permalink
    Definition Classes
    Any
  7. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  8. def ensuring(cond: (HttpClient[F]) ⇒ Boolean, msg: ⇒ Any): HttpClient[F]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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]

    Permalink
    Implicit information
    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

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

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

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def formatted(fmtstr: String): String

    Permalink
    Implicit information
    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
    @inline()
  16. final def getClass(): Class[_]

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

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
  22. final def synchronized[T0](arg0: ⇒ T0): T0

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

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

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. def [B](y: B): (HttpClient[F], B)

    Permalink
    Implicit information
    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

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