Response

zio.http.Response
See theResponse companion object
final case class Response(status: Status, headers: Headers = ..., body: Body = ..., version: Version = ...)

Immutable HTTP response consisting of status, headers, body, and protocol version.

Attributes

Companion
object
Source
Response.scala
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

Attributes

Source
Response.scala
def addHeader(name: String, value: String): Response

Attributes

Source
Response.scala
def addHeader(header: Header): Response

Attributes

Source
Response.scala
def addHeaders(other: Headers): Response

Attributes

Source
Response.scala
def body(body: Body): Response

Returns a copy with the supplied body and a synchronized Content-Type header.

Returns a copy with the supplied body and a synchronized Content-Type header.

This overwrites any existing Content-Type header with body.contentType.render so the headers remain aligned with the body.

Attributes

Source
Response.scala
def contentType: Option[ContentType]

Returns this response's content type.

Returns this response's content type.

The typed Content-Type header is preferred when present and parseable. If the header is absent or cannot be parsed as a typed Content-Type header, this method falls back to the body's content type.

Attributes

Source
Response.scala

Attributes

Source
Response.scala
def header[A](headerCodec: Codec[A]): Option[A]

Decodes the first response header matching the supplied codec.

Decodes the first response header matching the supplied codec.

Attributes

Source
Response.scala
def removeHeader(name: String): Response

Attributes

Source
Response.scala
def setHeader(name: String, value: String): Response

Attributes

Source
Response.scala
def setHeader(header: Header): Response

Attributes

Source
Response.scala
def status(status: Status): Response

Attributes

Source
Response.scala

Attributes

Source
Response.scala
def version(version: Version): Response

Attributes

Source
Response.scala

Inherited methods

def productElementNames: Iterator[String]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala