Encoding / Decoding

The HTTP spec defines a Content-Encoding header, which signifies whether the entity body of an HTTP message is “encoded” and, if so, by which algorithm. The only commonly used content encodings are compression algorithms.

Currently Akka HTTP supports the compression and decompression of HTTP requests and responses with the gzip or deflate encodings. The core logic for this lives in the akka.http.scaladsl.coding package.

The support is not enabled automatically, but must be explicitly requested. For enabling message encoding/decoding with Routing DSL see the CodingDirectives.

The source code for this page can be found here.