ResponseSyntax

endpoints4s.algebra.Responses.ResponseSyntax
implicit class ResponseSyntax[A](response: Response[A])

Extension methods for Response.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

final def addHeaders[H](headers: ResponseHeaders[H])(implicit tupler: Tupler[A, H]): Response[Out]

Add the provided headers to this response.

Add the provided headers to this response.

Note that if the response describes a choice of several possible responses (resulting from the orElse operation), the headers will be added to all the possible responses.

Attributes

final def orElse[B](otherResponse: Response[B]): Response[Either[A, B]]

Alternative between two possible choices of responses.

Alternative between two possible choices of responses.

Server interpreters construct either one or the other response. Client interpreters accept either one or the other response. Documentation interpreters list all the possible responses.

Attributes

final def orNotFound(notFoundDocs: Documentation): Response[Option[A]]

Turns a Response[A] into a Response[Option[A]].

Turns a Response[A] into a Response[Option[A]].

Interpreters represent None with an empty HTTP response whose status code is 404 (Not Found).

Attributes