Back to HTTP Headers
Response

HTTP Content-Encoding Header

Indicates which compression algorithm was applied to the response body. The client must use the same algorithm to decompress the data.

Purpose

Reduces response payload size by applying compression, improving transfer speed and bandwidth usage.

Content-Encoding: gzip Content-Encoding: br (Brotli) Content-Encoding: deflate Content-Encoding: identity (no encoding)

Code Examples

See how to use the Content-Encoding header in different tools and languages.

curl -I --compressed https://api.example.com/data
# Response header:
# Content-Encoding: gzip

# Without compression:
curl -H "Accept-Encoding: identity" https://api.example.com/data

Related Headers

Test Your APIs

content-encoding headerhttp content-encodinghttp headers guide