Response

io.quartz.http2.model.Response
See theResponse companion object
sealed case class Response(code: StatusCode, headers: Headers, stream: Stream[IO, Byte])

Represents an HTTP response, including the response code, headers, and a response body as a Stream of bytes. Responses are immutable and can be modified using various helper methods.

Attributes

code

the HTTP response code, such as 200 OK or 404 Not Found.

headers

the HTTP headers associated with the response.

stream

the response body as a Stream of bytes. Defaults to an empty stream.

Companion:
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any

Members list

Concise view

Value members

Concrete methods

def asStream(s0: Stream[IO, Byte]): Response

Sets the response body to the given Stream of bytes.

Sets the response body to the given Stream of bytes.

Attributes

def asText(text: String): Response

Sets the response body to the given text string, encoded as bytes.

Sets the response body to the given text string, encoded as bytes.

Attributes

Sets the content type header for the response.

Sets the content type header for the response.

Attributes

def hdr(hdr: Headers): Response

Adds the given headers to the response headers.

Adds the given headers to the response headers.

Attributes

def hdr(pair: (String, String)): Response

Adds a single header to the response headers, given as a tuple of (name, value).

Adds a single header to the response headers, given as a tuple of (name, value).

Attributes

def isChunked: Boolean

Returns true if the response body is sent using chunked encoding.

Returns true if the response body is sent using chunked encoding.

Attributes

def transferEncoding(): List[String]

Returns the list of transfer encoding values associated with the response.

Returns the list of transfer encoding values associated with the response.

Attributes

def transferEncoding(vals0: String*): Response

Sets the transfer encoding header for the response.

Sets the transfer encoding header for the response.

Attributes

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product