Response

zio.http.Response
See theResponse companion class
object Response

Attributes

Companion
class
Graph
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Response.type

Members list

Type members

Classlikes

object Patch

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Patch.type
sealed trait Patch

Models the set of operations that one would want to apply on a Response.

Models the set of operations that one would want to apply on a Response.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AddHeaders
class Combine
object Empty.type
class SetStatus
Show all
Self type

Inherited types

type MirroredElemLabels <: Tuple

The names of the product elements

The names of the product elements

Attributes

Inherited from:
Mirror
type MirroredLabel <: String

The name of the type

The name of the type

Attributes

Inherited from:
Mirror

Value members

Concrete methods

def badRequest(message: String): Response
def error(status: Error, message: String): Response
def error(status: Error): Response
def forbidden(message: String): Response
def fromCause(cause: Cause[Any]): Response

Creates a new response from the specified cause. Note that this method is not polymorphic, but will attempt to inspect the runtime class of the failure inside the cause, if any.

Creates a new response from the specified cause. Note that this method is not polymorphic, but will attempt to inspect the runtime class of the failure inside the cause, if any.

Attributes

def fromCauseWith[E](cause: Cause[E])(f: E => Response): Response

Creates a new response from the specified cause, translating any typed error to a response using the provided function.

Creates a new response from the specified cause, translating any typed error to a response using the provided function.

Attributes

def fromServerSentEvents(data: ZStream[Any, Nothing, ServerSentEvent])(implicit trace: Trace): Response

Creates a response with content-type set to text/event-stream

Creates a response with content-type set to text/event-stream

Value parameters

data

- stream of data to be sent as Server Sent Events

Attributes

def fromSocketApp[R](app: WebSocketApp[R])(implicit trace: Trace): ZIO[R, Nothing, Response]

Creates a new response for the provided socket app

Creates a new response for the provided socket app

Attributes

def fromThrowable(throwable: Throwable): Response

Creates a new response for the specified throwable. Note that this method relies on the runtime class of the throwable.

Creates a new response for the specified throwable. Note that this method relies on the runtime class of the throwable.

Attributes

def gatewayTimeout(message: String): Response
def html(data: Html, status: Status): Response

Creates a response with content-type set to text/html

Creates a response with content-type set to text/html

Attributes

def httpVersionNotSupported(message: String): Response
def internalServerError(message: String): Response
def json(data: CharSequence): Response

Creates a response with content-type set to application/json

Creates a response with content-type set to application/json

Attributes

def networkAuthenticationRequired(message: String): Response
def notExtended(message: String): Response
def notFound(message: String): Response
def notImplemented(message: String): Response
def ok: Response

Creates an empty response with status 200

Creates an empty response with status 200

Attributes

def redirect(location: URL, isPermanent: Boolean): Response

Creates an empty response with status 307 or 308 depending on if it's permanent or not.

Creates an empty response with status 307 or 308 depending on if it's permanent or not.

Note: if you intend to always redirect a browser with a HTTP GET to the given location you very likely should use Response#seeOther instead.

Attributes

def seeOther(location: URL): Response

Creates an empty response with status 303.

Creates an empty response with status 303.

Attributes

def serviceUnavailable(message: String): Response
def status(status: Status): Response

Creates an empty response with the provided Status

Creates an empty response with the provided Status

Attributes

def text(text: CharSequence): Response

Creates a response with content-type set to text/plain

Creates a response with content-type set to text/plain

Attributes

def unauthorized(message: String): Response