A zio.http.codec.HttpCodec represents a codec for a part of an HTTP request. HttpCodec the HTTP protocol, these parts may be the unconsumed portion of the HTTP path (a route codec), the query string parameters (a query codec), the request headers (a header codec), or the request body (a body codec).
A HttpCodec is a purely declarative description of an input, and therefore, it can be used to generate documentation, clients, and client libraries.
HttpCodecs are a bit like invertible multi-channel parsers.
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
Members list
Value members
Concrete methods
Append more query parameters to either a query codec, or to a pathQuery codec which is a combination of path and query
Append more query parameters to either a query codec, or to a pathQuery codec which is a combination of path and query
Attributes
Returns a new codec that is the composition of this codec and the specified codec. For codecs that include route codecs, the routes will be decoded sequentially from left to right.
Returns a new codec that is the composition of this codec and the specified codec. For codecs that include route codecs, the routes will be decoded sequentially from left to right.
Attributes
Returns a new codec that is the same as this one, but has attached docs, which will render whenever docs are generated from the codec.
Returns a new codec that is the same as this one, but has attached docs, which will render whenever docs are generated from the codec.
Attributes
To end the route codec and begin with query codec, and re-interprets as PathQueryCodec
To end the route codec and begin with query codec, and re-interprets as PathQueryCodec
GET /ab/c :? paramStr("") &
Attributes
Produces a flattened collection of alternatives. Once flattened, each codec inside the returned collection is guaranteed to contain no nested alternatives.
Produces a flattened collection of alternatives. Once flattened, each codec inside the returned collection is guaranteed to contain no nested alternatives.
Attributes
Returns a new codec that is the same as this one, but has attached metadata, such as docs.
Returns a new codec that is the same as this one, but has attached metadata, such as docs.
Attributes
Reinterprets this codec as a query codec assuming evidence that this interpretation is sound.
Reinterprets this codec as a query codec assuming evidence that this interpretation is sound.
Attributes
Transforms the type parameter to Unit
by specifying that all possible values that can be decoded from this HttpCodec
are in fact equivalent to the provided canonical value.
Transforms the type parameter to Unit
by specifying that all possible values that can be decoded from this HttpCodec
are in fact equivalent to the provided canonical value.
Note: You should NOT use this method on any codec which can decode semantically distinct values.
Attributes
Uses this codec to decode the Scala value from a request.
Uses this codec to decode the Scala value from a request.
Attributes
Uses this codec to decode the Scala value from a response.
Uses this codec to decode the Scala value from a response.
Attributes
Uses this codec to encode the Scala value into a request.
Uses this codec to encode the Scala value into a request.
Attributes
Uses this codec to encode the Scala value as a patch to a request.
Uses this codec to encode the Scala value as a patch to a request.
Attributes
Uses this codec to encode the Scala value as a response.
Uses this codec to encode the Scala value as a response.
Attributes
Uses this codec to encode the Scala value as a response patch.
Uses this codec to encode the Scala value as a response patch.
Attributes
Returns a new codec that will expect the value to be equal to the specified value.
Returns a new codec that will expect the value to be equal to the specified value.
Attributes
Returns a new codec that is the same as this one, but has attached a name. This name is used for documentation generation.
Returns a new codec that is the same as this one, but has attached a name. This name is used for documentation generation.
Attributes
Returns a new codec, where the value produced by this one is optional.
Returns a new codec, where the value produced by this one is optional.
Attributes
Transforms the type parameter of this HttpCodec from Value
to Value2
. Due to the fact that HttpCodec is invariant in its type parameter, the transformation requires not just a function from Value
to Value2
, but also, a function from Value2
to Value
.
Transforms the type parameter of this HttpCodec from Value
to Value2
. Due to the fact that HttpCodec is invariant in its type parameter, the transformation requires not just a function from Value
to Value2
, but also, a function from Value2
to Value
.
One of these functions will be used in decoding, for example, when the endpoint is invoked on the server. The other of these functions will be used in encoding, for example, when a client calls the endpoint on the server.