Name

Accept-Encoding

Synopsis

The Accept-Encoding header is used by clients to tell servers what encodings are acceptable. If the content the server is holding is encoded (perhaps compressed), this request header lets the server know whether the client will accept it. Chapter 17 contains a complete description of the Accept-Encoding header.

Type

Request header

Basic Syntax

Accept-Encoding: 1# ((content-coding | “*”) [”;" “q” “=” qvalue])

Examples

Accept-Encoding:[1]

Accept-Encoding: gzip

Accept-Encoding: compress;q=0.5, gzip;q=1

[1] The empty Accept-Encoding example is not a typo. It refers to the identity encoding—that is, the unencoded content. If the Accept-Encoding header is present and empty, only the unencoded content is acceptable.

Get HTTP: The Definitive Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.