Responses
Attributes
- Graph
-
- Supertypes
- Known subtypes
-
trait Assetstrait BasicAuthenticationtrait ChunkedEntitiestrait ChunkedJsonEntitiestrait Endpointstrait JsonEntitiestrait JsonCodecstrait JsonEntitiesFromCodecstrait JsonEntitiesFromSchemastrait LowLevelEndpointstrait MuxEndpointsShow all
- Self type
Members list
Type members
Classlikes
Inherited classlikes
Extension methods for values of type F[A]
for which there is an implicit InvariantFunctor[F]
instance.
Extension methods for values of type F[A]
for which there is an implicit InvariantFunctor[F]
instance.
Attributes
- Inherited from:
- InvariantFunctorSyntax
- Supertypes
-
class Objecttrait Matchableclass Any
Types
An HTTP response (status, headers, and entity) carrying an information of type A
An HTTP response (status, headers, and entity) carrying an information of type A
Values of type Response[A]
can be constructed by using the operations ok, badRequest, internalServerError, or the more general operation response.
Attributes
- Note
-
This type has implicit methods provided by the InvariantFunctorSyntax and ResponseSyntax classes
An HTTP response entity carrying an information of type A
An HTTP response entity carrying an information of type A
Values of type ResponseEntity can be constructed by using the operations emptyResponse or textResponse. Additional types of response entities are provided by other algebra modules, such as JsonEntities or ChunkedEntities.
Attributes
- Note
-
This type has implicit methods provided by the InvariantFunctorSyntax class
Information carried by responses’ headers.
Information carried by responses’ headers.
You can construct values of type ResponseHeaders
by using the operations responseHeader, optResponseHeader, or emptyResponseHeaders.
Attributes
- Note
-
This type has implicit methods provided by the SemigroupalSyntax and InvariantFunctorSyntax classes.
Inherited types
HTTP Status Code
Value members
Abstract methods
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
Empty response entity
Empty response entity
- Server interpreters produce no response entity,
- Client interpreters ignore the response entity.
Attributes
No particular response header.
No particular response header.
- Client interpreters should ignore information carried by response headers.
Attributes
Response headers optionally containing a header with the given name
.
Response headers optionally containing a header with the given name
.
- Client interpreters should model the header value as
Some[String]
, orNone
if the response header is missing. - Server interpreters should produce such a response header.
- Documentation interpreters should document this header.
Attributes
Define an HTTP response
Define an HTTP response
- Server interpreters construct a response with the given status and entity.
- Client interpreters accept a response only if it has a corresponding status code.
Value parameters
- docs
-
Response documentation
- entity
-
Response entity
- headers
-
Response headers
- statusCode
-
Response status code
Attributes
Response headers containing a header with the given name
.
Response headers containing a header with the given name
.
- Client interpreters should model the header value as
String
, or fail if the response header is missing. - Server interpreters should produce such a response header.
- Documentation interpreters should document this header.
Example:
val versionedResource: Endpoint[Unit, (SomeResource, String)] =
endpoint(
get(path / "versioned-resource"),
ok(
jsonResponse[SomeResource],
headers = responseHeader("ETag")
)
)
Attributes
Text response entity
Text response entity
- Server interpreters produce an HTTP response with a
text/plain
content type.
Attributes
Concrete methods
Add the provided headers
to the response
.
Add the provided headers
to the 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
Bad Request (400) response, with an entity of type ClientErrors
.
Bad Request (400) response, with an entity of type ClientErrors
.
Attributes
- See also
Internal Server Error (500) response, with an entity of type ServerError
.
Internal Server Error (500) response, with an entity of type ServerError
.
Attributes
- See also
OK (200) Response with the given entity
OK (200) Response with the given entity
Attributes
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
Inherited methods
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Note
-
You should use the
badRequest
constructor provided by the endpoints4s.algebra.Responses trait to ensure that errors produced by endpoints4s are consistently handled by interpreters. - Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Note
-
You should use the
internalServerError
constructor provided by the endpoints4s.algebra.Responses trait to ensure that errors produced by endpoints4s are consistently handled by interpreters. - Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Attributes
- Inherited from:
- StatusCodes
Implicits
Implicits
Provides xmap
operation.
Provides xmap
operation.
Attributes
- See also
-
InvariantFunctorSyntax
Provides ++
operation.
Provides the operation xmap
to the type Response
Provides the operation xmap
to the type Response
Attributes
- See also
-
InvariantFunctorSyntax
Inherited implicits
Extension methods for values of type F[A]
for which there is an implicit InvariantFunctor[F]
instance.
Extension methods for values of type F[A]
for which there is an implicit InvariantFunctor[F]
instance.
Attributes
- Inherited from:
- InvariantFunctorSyntax