Packages

final class Response[+F[_]] extends Message[F] with Product with Serializable

Representation of the HTTP response to send back to the client

Source
Message.scala
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Response
  2. Serializable
  3. Product
  4. Equals
  5. Message
  6. Media
  7. AnyRef
  8. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Type Members

  1. type SelfF[F0[_]] = Response[F0]
    Definition Classes
    ResponseMessage

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def addCookie(name: String, content: String, expires: Option[HttpDate] = None): Response[F]

    Add a org.http4s.headers.Set-Cookie header with the provided values

  5. def addCookie(cookie: ResponseCookie): Response[F]

    Add a Set-Cookie header for the provided ResponseCookie

  6. def addHeader[H](h: H)(implicit arg0: Header[H, Recurring]): SelfF[F]

    Add a header to these headers.

    Add a header to these headers. The header should be a type with a recurring Header instance to ensure that the new value can be appended to any existing values.

    >>> import org.http4s.headers.Accept
    
    >>> val req = Request().addHeader(Accept(MediaRange.`application/*`))
    >>> req.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*)))
    
    >>> val req2 = req.addHeader(Accept(MediaRange.`text/*`))
    >>> req2.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*, text/*)))

    */*/*/*/*/

    Definition Classes
    Message
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val attributes: Vault
    Definition Classes
    ResponseMessage
  9. final def body: EntityBody[F]
    Definition Classes
    Media
  10. final def bodyText[F2[x] >: F[x]](implicit RT: RaiseThrowable[F2], defaultCharset: Charset = `UTF-8`): Stream[F2, String]
    Definition Classes
    Media
  11. def canEqual(that: Any): Boolean
    Definition Classes
    Response → Equals
  12. def change[F1[_]](httpVersion: HttpVersion, entity: Entity[F1], headers: Headers, attributes: Vault): Response[F1]
    Attributes
    protected
    Definition Classes
    ResponseMessage
  13. final def charset: Option[Charset]
    Definition Classes
    Media
  14. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  15. final def contentLength: Option[Long]
    Definition Classes
    Media
  16. final def contentType: Option[Content-Type]
    Definition Classes
    Media
  17. def cookies: List[ResponseCookie]

    Returns a list of cookies from the org.http4s.headers.Set-Cookie headers.

    Returns a list of cookies from the org.http4s.headers.Set-Cookie headers. Includes expired cookies, such as those that represent cookie deletion.

  18. def copy[F1[_]](status: Status = this.status, httpVersion: HttpVersion = this.httpVersion, headers: Headers = this.headers, entity: Entity[F1] = this.entity, attributes: Vault = this.attributes): Response[F1]
  19. def covary[F2[x] >: F[x]]: SelfF[F2]

    Lifts this Message's body to the specified effect type.

    Lifts this Message's body to the specified effect type.

    Definition Classes
    MessageMedia
  20. val entity: Entity[F]
    Definition Classes
    ResponseMedia
  21. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  22. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  23. def filterHeaders(f: (Raw) => Boolean): SelfF[F]

    Keep headers that satisfy the predicate

    Keep headers that satisfy the predicate

    f

    predicate

    returns

    a new message object which has only headers that satisfy the predicate

    Definition Classes
    Message
  24. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  25. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  26. def hashCode(): Int
    Definition Classes
    Response → AnyRef → Any
  27. val headers: Headers
    Definition Classes
    ResponseMedia
  28. val httpVersion: HttpVersion
    Definition Classes
    ResponseMessage
  29. def isChunked: Boolean
    Definition Classes
    Message
  30. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  31. def mapK[F2[x] >: F[x], G[_]](f: ~>[F2, G]): SelfF[G]
    Definition Classes
    Message
  32. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. def productArity: Int
    Definition Classes
    Response → Product
  36. def productElement(n: Int): Any
    Definition Classes
    Response → Product
  37. def productElementName(n: Int): String
    Definition Classes
    Product
  38. def productElementNames: Iterator[String]
    Definition Classes
    Product
  39. def productIterator: Iterator[Any]
    Definition Classes
    Product
  40. def productPrefix: String
    Definition Classes
    Product
  41. def putHeaders(headers: ToRaw*): SelfF[F]

    Add the provided headers to the existing headers, replacing those of the same header name

    Add the provided headers to the existing headers, replacing those of the same header name

    >>> import org.http4s.headers.Accept
    
    >>> val req = Request().putHeaders(Accept(MediaRange.`application/*`))
    >>> req.headers.get[Accept]
    Some(Accept(NonEmptyList(application/*)))
    
    >>> val req2 = req.putHeaders(Accept(MediaRange.`text/*`))
    >>> req2.headers.get[Accept]
    Some(Accept(NonEmptyList(text/*)))

    */*/*/*/

    Definition Classes
    Message
  42. def removeCookie(name: String): Response[F]

    Add a org.http4s.headers.Set-Cookie which will remove the specified cookie from the client

  43. def removeCookie(cookie: ResponseCookie): Response[F]

    Add a org.http4s.headers.Set-Cookie which will remove the specified cookie from the client

  44. def removeHeader[A](implicit h: Header[A, _]): SelfF[F]
    Definition Classes
    Message
  45. def removeHeader(key: CIString): SelfF[F]
    Definition Classes
    Message
  46. def responsePrelude: ResponsePrelude

    A projection of this response without the body.

  47. val status: Status
  48. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  49. def toStrict[F1[x] >: F[x]](maxBytes: Option[Long])(implicit F: Concurrent[F1]): F1[SelfF[Pure]]

    Compiles the body stream to a single chunk and sets it as the body.

    Compiles the body stream to a single chunk and sets it as the body. Replaces any Transfer-Encoding: chunked with a Content-Length header. It is the caller's responsibility to assure there is enough memory to materialize the entity body and control the time limits of that materialization.

    maxBytes

    maximum length of the entity stream. If the stream exceeds the limit then processing fails with the Message.EntityStreamException. Pass the scala.None if you don't want to limit the entity body.

    Definition Classes
    Message
  50. def toString(): String
    Definition Classes
    Response → AnyRef → Any
  51. def trailerHeaders[F1[x] >: F[x]](implicit F: Applicative[F1]): F1[Headers]

    The trailer headers, as specified in Section 3.6.1 of RFC 2616.

    The trailer headers, as specified in Section 3.6.1 of RFC 2616. The resulting F might not complete until the entire body has been consumed.

    Definition Classes
    Message
  52. def transformHeaders(f: (Headers) => Headers): SelfF[F]
    Definition Classes
    Message
  53. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  54. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  55. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  56. def withAttribute[A](key: Key[A], value: A): SelfF[F]

    Generates a new message object with the specified key/value pair appended to the attributes.

    Generates a new message object with the specified key/value pair appended to the attributes.

    A

    type of the value to store

    key

    org.typelevel.vault.Key with which to associate the value

    value

    value associated with the key

    returns

    a new message object with the key/value pair appended

    Definition Classes
    Message
  57. def withAttributes(attributes: Vault): SelfF[F]
    Definition Classes
    Message
  58. def withBodyStream[F1[x] >: F[x]](body: EntityBody[F1]): SelfF[F1]

    Sets the entity body without affecting headers such as Transfer-Encoding or Content-Length.

    Sets the entity body without affecting headers such as Transfer-Encoding or Content-Length. Most use cases are better served by withEntity[F1[x]](entity*, which uses an EntityEncoder to maintain the headers.

    WARNING: this method does not modify the headers of the message, and as a consequence headers may be incoherent with the body.

    Definition Classes
    Message
  59. def withContentType(contentType: Content-Type): SelfF[F]
    Definition Classes
    Message
  60. def withContentTypeOption(contentTypeO: Option[Content-Type]): SelfF[F]
    Definition Classes
    Message
  61. def withEmptyBody: SelfF[Pure]

    Set an Entity.Empty entity on this message, and remove all payload headers that make no sense with an empty body.

    Set an Entity.Empty entity on this message, and remove all payload headers that make no sense with an empty body.

    Definition Classes
    Message
  62. def withEntity[F1[x]](entity: Entity[F1]): SelfF[F1]
    Definition Classes
    Message
  63. def withEntity[F1[x] >: F[x], T](b: T)(implicit w: EntityEncoder[F1, T]): SelfF[F1]

    Replace the body of this message with a new body

    Replace the body of this message with a new body

    T

    type of the Body

    b

    body to attach to this method

    w

    EntityEncoder with which to convert the body to an EntityBody

    returns

    a new message with the new body

    Definition Classes
    Message
  64. def withHeaders(headers: ToRaw*): SelfF[F]
    Definition Classes
    Message
  65. def withHeaders(headers: Headers): SelfF[F]
    Definition Classes
    Message
  66. def withHttpVersion(httpVersion: HttpVersion): SelfF[F]
    Definition Classes
    Message
  67. def withStatus(status: Status): Response[F]
  68. def withTrailerHeaders[F1[x] >: F[x]](trailerHeaders: F1[Headers]): SelfF[F1]
    Definition Classes
    Message
  69. def withoutAttribute(key: Key[_]): SelfF[F]

    Returns a new message object without the specified key in the attributes.

    Returns a new message object without the specified key in the attributes.

    key

    org.typelevel.vault.Key to remove

    returns

    a new message object without the key

    Definition Classes
    Message
  70. def withoutContentType: SelfF[F]
    Definition Classes
    Message
  71. def withoutTrailerHeaders: SelfF[F]
    Definition Classes
    Message

Inherited from Serializable

Inherited from Product

Inherited from Equals

Inherited from Message[F]

Inherited from Media[F]

Inherited from AnyRef

Inherited from Any

Ungrouped