trait CodingDirectives extends AnyRef
- Grouped
- Alphabetic
- By Inheritance
- CodingDirectives
- AnyRef
- Any
- by any2stringadd
- by StringFormat
- by Ensuring
- by ArrowAssoc
- Hide All
- Show All
- Public
- Protected
Coding directives
- def decodeRequest: Directive0
Decompresses the incoming request if it is
gzip
ordeflate
compressed.Decompresses the incoming request if it is
gzip
ordeflate
compressed. Uncompressed requests are passed through untouched. If the request encoded with another encoding the request is rejected with anUnsupportedRequestEncodingRejection
. - def decodeRequestWith(decoders: Decoder*): Directive0
Decodes the incoming request if it is encoded with one of the given encoders.
Decodes the incoming request if it is encoded with one of the given encoders. If the request encoding doesn't match one of the given encoders the request is rejected with an
UnsupportedRequestEncodingRejection
. If no decoders are given the default encoders (Gzip
,Deflate
,NoCoding
) are used. - def decodeRequestWith(decoder: Decoder): Directive0
Decodes the incoming request using the given Decoder.
Decodes the incoming request using the given Decoder. If the request encoding doesn't match the request is rejected with an
UnsupportedRequestEncodingRejection
. - def encodeResponse: Directive0
Encodes the response with the encoding that is requested by the client via the
Accept- Encoding
header.Encodes the response with the encoding that is requested by the client via the
Accept- Encoding
header. The response encoding is determined by the rules specified in http://tools.ietf.org/html/rfc7231#section-5.3.4.If the
Accept-Encoding
header is missing or empty or specifies an encoding other than identity, gzip or deflate then no encoding is used. - def encodeResponseWith(first: Encoder, more: Encoder*): Directive0
Encodes the response with the encoding that is requested by the client via the
Accept- Encoding
header.Encodes the response with the encoding that is requested by the client via the
Accept- Encoding
header. The response encoding is determined by the rules specified in http://tools.ietf.org/html/rfc7231#section-5.3.4.If the
Accept-Encoding
header is missing then the response is encoded using thefirst
encoder.If the
Accept-Encoding
header is empty andNoCoding
is part of the encoders then no response encoding is used. Otherwise the request is rejected. - def requestEncodedWith(encoding: HttpEncoding): Directive0
Rejects the request with an UnsupportedRequestEncodingRejection if its encoding doesn't match the given one.
- def responseEncodingAccepted(encoding: HttpEncoding): Directive0
Rejects the request with an UnacceptedResponseEncodingRejection if the given response encoding is not accepted by the client.
- def withPrecompressedMediaTypeSupport: Directive0
Inspects the response entity and adds a
Content-Encoding: gzip
response header if the entity's media-type is precompressed with gzip and noContent-Encoding
header is present yet.