Back to HTTP Headers
Request

HTTP Accept-Encoding Header

Indicates which content encoding (compression algorithm) the client supports. The server may compress the response body using one of these methods.

Purpose

Enables the server to compress the response, reducing bandwidth usage and improving load times.

Accept-Encoding: gzip Accept-Encoding: compress, gzip Accept-Encoding: br Accept-Encoding: identity (no compression)

Code Examples

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

curl -H "Accept-Encoding: gzip" https://api.example.com/data
curl --compressed https://api.example.com/data

Related Headers

Test Your APIs

accept-encoding headerhttp accept-encodinghttp headers guide