TE
The HTTP TE request header indicates the transfer encodings the client is willing to accept and whether the client supports trailer fields in chunked transfers.
Usage
The TE header lets a client communicate transfer encoding preferences to the server. The server uses this information to choose an appropriate encoding for the Transfer-Encoding of the response body.
In HTTP/1.1, chunked transfer encoding is always implicitly supported and does not need to be listed in the TE header. The header primarily serves two purposes: advertising support for additional Compression algorithms (gzip, deflate, compress) applied at the transfer level, and signaling support for Trailer fields.
The trailers value is especially important. Without
the client declaring TE: trailers, a server has no
guarantee the client processes trailer fields, even
when the response uses chunked encoding. Trailer
fields carry metadata like checksums or digital
signatures appended after the message body.
Each encoding directive accepts an optional quality
value (q) ranging from 0 to 1, where higher values
express stronger preference. When no quality value is
present, the server treats the preference as 1.
Note
In HTTP/2 and HTTP/3, the only accepted
value for the TE header is trailers.
Transfer-level encodings are handled by the protocol
framing layer.
Directives
trailers
The trailers directive signals the client accepts
Trailer fields in a chunked transfer
encoding. This value does not participate in quality
value ranking.
gzip
The gzip directive indicates the client supports
Lempel-Ziv coding (LZ77) with a 32-bit CRC at the
transfer level.
deflate
The deflate directive indicates the client supports
zlib-compressed data at the transfer level.
compress
The compress directive indicates the client supports
Lempel-Ziv-Welch (LZW) compression at the transfer
level.
q (quality value)
The q parameter assigns a relative weight to each
encoding preference. Values range from 0 (not
acceptable) to 1 (most preferred). The server uses
quality values to select the best transfer encoding.
Example
A client advertises support for trailer fields and deflate transfer encoding. The quality value of 0.5 gives deflate a lower priority compared to the implicit default of 1 for other listed encodings.
TE: trailers, deflate;q=0.5
A client prefers gzip transfer encoding and also accepts compressed transfers with lower priority.
TE: gzip, compress;q=0.7
A client signals only trailer support. This is the standard form used with HTTP/2 connections.
TE: trailers
Takeaway
The TE request header advertises the transfer encodings a client accepts and signals support for Trailer fields in chunked responses.