Class

lol.http

Response

Related Doc: package http

Permalink

case class Response(status: Int, content: Content = Content.empty, headers: Map[HttpString, HttpString] = Map.empty) extends Product with Serializable

An HTTP response.

Represent all the data available in the HTTP response headers, and the response content that can be consumed lazily if needed.

status

the HTTP response code such as 200 or 404.

content

the response content.

headers

the HTTP headers.

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

Instance Constructors

  1. new Response(status: Int, content: Content = Content.empty, headers: Map[HttpString, HttpString] = Map.empty)

    Permalink

    status

    the HTTP response code such as 200 or 404.

    content

    the response content.

    headers

    the HTTP headers.

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. def addHeaders(headers: (HttpString, HttpString)*): Response

    Permalink

    Add some headers to this response.

    Add some headers to this response.

    headers

    the new headers to add.

    returns

    a copy of the response with the new headers added.

  5. def addHeaders(headers: Map[HttpString, HttpString]): Response

    Permalink

    Add some headers to this response.

    Add some headers to this response.

    headers

    the new headers to add.

    returns

    a copy of the response with the new headers added.

  6. def apply[A](content: A)(implicit encoder: ContentEncoder[A]): Response

    Permalink

    Set the content of this response.

    Set the content of this response.

    content

    the content to use for this response.

    encoder

    the ContentEncoder to use to encode this content.

    returns

    a copy of this response with a new content.

  7. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  8. def assertSuccess: IO[Unit]

    Permalink

    Return a successful unit IO if the response status is in the Success 2xx range.

    Return a successful unit IO if the response status is in the Success 2xx range. Otherwise, it consumes the response as String and report the error as a failed IO.

  9. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val content: Content

    Permalink

    the response content.

  11. def drain: IO[Unit]

    Permalink

    Drain the content attached to this response.

    Drain the content attached to this response. It is safe to call this operation even if the stream has already been consumed.

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

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

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

    Permalink
    Definition Classes
    AnyRef → Any
  15. val headers: Map[HttpString, HttpString]

    Permalink

    the HTTP headers.

  16. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  17. def isRedirect: Boolean

    Permalink

    returns

    true is this HTTP response is a redirect.

  18. final def ne(arg0: AnyRef): Boolean

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

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

    Permalink
    Definition Classes
    AnyRef
  21. def read[A](effect: (Stream[IO, Byte]) ⇒ IO[A]): IO[A]

    Permalink

    Consume the content attached to this response by evaluating the provided effect function.

    Consume the content attached to this response by evaluating the provided effect function.

    effect

    the function to use to consume the stream.

    returns

    eventually a value of type A.

  22. def readAs[A](implicit decoder: ContentDecoder[A]): IO[A]

    Permalink

    Consume the content attached to this response and eventually produces a value of type A.

    Consume the content attached to this response and eventually produces a value of type A.

    decoder

    the ContentDecoder to use to read the content.

    returns

    eventually a value of type A.

  23. def readSuccess[A](effect: (Stream[IO, Byte]) ⇒ IO[A]): IO[A]

    Permalink

    Consume the content attached to this response by evaluating the provided effect function the status is in the Success 2xx range.

    Consume the content attached to this response by evaluating the provided effect function the status is in the Success 2xx range. Otherwise, it consumes the response as String and report the error as a failed IO.

    effect

    the function to use to consume the stream.

    returns

    eventually a value of type A or a failure if the status code was not 2xx.

  24. def readSuccessAs[A](implicit decoder: ContentDecoder[A]): IO[A]

    Permalink

    Consume the content attached to this response if the status is in the Success 2xx range.

    Consume the content attached to this response if the status is in the Success 2xx range. Otherwise, it consumes the response as String and report the error as a failed IO.

    decoder

    the ContentDecoder to use to read the content.

    returns

    eventually a value of type A or a failure if the status code was not 2xx.

  25. def removeHeaders(headerNames: HttpString*): Response

    Permalink

    Remove some headers from this response.

    Remove some headers from this response.

    headerNames

    the header names to remove

    returns

    a copy of the response without the removed headers.

  26. val status: Int

    Permalink

    the HTTP response code such as 200 or 404.

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

    Permalink
    Definition Classes
    AnyRef
  28. final def wait(): Unit

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

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

Inherited from Any

Ungrouped