public interface CodingDirectives
Modifier and Type | Method and Description |
---|---|
Directive<scala.runtime.BoxedUnit> |
decodeRequest()
Decompresses the incoming request if it is
gzip or deflate compressed. |
Directive<scala.runtime.BoxedUnit> |
decodeRequestWith(Decoder decoder)
Decodes the incoming request using the given Decoder.
|
Directive<scala.runtime.BoxedUnit> |
decodeRequestWith(scala.collection.immutable.Seq<Decoder> decoders)
Decodes the incoming request if it is encoded with one of the given
encoders.
|
Directive<scala.runtime.BoxedUnit> |
encodeResponse()
Encodes the response with the encoding that is requested by the client via the
Accept-
Encoding header. |
Directive<scala.runtime.BoxedUnit> |
encodeResponseWith(Encoder first,
scala.collection.immutable.Seq<Encoder> more)
Encodes the response with the encoding that is requested by the client via the
Accept-
Encoding header. |
Directive<scala.runtime.BoxedUnit> |
requestEncodedWith(HttpEncoding encoding)
Rejects the request with an UnsupportedRequestEncodingRejection if its encoding doesn't match the given one.
|
Directive<scala.runtime.BoxedUnit> |
responseEncodingAccepted(HttpEncoding encoding)
Rejects the request with an UnacceptedResponseEncodingRejection
if the given response encoding is not accepted by the client.
|
Directive<scala.runtime.BoxedUnit> |
withPrecompressedMediaTypeSupport()
Inspects the response entity and adds a
Content-Encoding: gzip response header if
the entity's media-type is precompressed with gzip and no Content-Encoding header is present yet. |
Directive<scala.runtime.BoxedUnit> responseEncodingAccepted(HttpEncoding encoding)
encoding
- (undocumented)Directive<scala.runtime.BoxedUnit> encodeResponse()
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.
Directive<scala.runtime.BoxedUnit> encodeResponseWith(Encoder first, scala.collection.immutable.Seq<Encoder> more)
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 the first
encoder.
If the Accept-Encoding
header is empty and NoCoding
is part of the encoders then no
response encoding is used. Otherwise the request is rejected.
first
- (undocumented)more
- (undocumented)Directive<scala.runtime.BoxedUnit> decodeRequestWith(Decoder decoder)
UnsupportedRequestEncodingRejection
.
decoder
- (undocumented)Directive<scala.runtime.BoxedUnit> requestEncodedWith(HttpEncoding encoding)
encoding
- (undocumented)Directive<scala.runtime.BoxedUnit> decodeRequestWith(scala.collection.immutable.Seq<Decoder> decoders)
UnsupportedRequestEncodingRejection
.
If no decoders are given the default encoders (Gzip
, Deflate
, NoCoding
) are used.
decoders
- (undocumented)Directive<scala.runtime.BoxedUnit> decodeRequest()
gzip
or deflate
compressed.
Uncompressed requests are passed through untouched.
If the request encoded with another encoding the request is rejected with an UnsupportedRequestEncodingRejection
.
Directive<scala.runtime.BoxedUnit> withPrecompressedMediaTypeSupport()
Content-Encoding: gzip
response header if
the entity's media-type is precompressed with gzip and no Content-Encoding
header is present yet.