TE
The TE
header field is a request header that lists which transfer codings, besides chunked, the client is willing to accept in response, and whether or not the client is willing to accept trailer fields in a chunked transfer coding.
Writing requests (clients)
List all the transfer codings the client is capable of reading, except for chunked
(which is required to be supported in HTTP/1.1). Additionally, if the client supports trailers in the chunked encoding, add trailers
. This header will typically always be the same.
Since TE
is a hop-by-hop header, clients must list it in the Connection header.
Reading requests (servers)
Servers should select the highest-ranked, earliest-listed transfer coding that is worth encoding, or else no coding if there are no matches. A "chunked" coding should be applied on top of the selected encoding, if any.
TE
is only meaningful in HTTP/1.1 requests. Ignore the header in other versions.
The Transfer-Encoding is hop-by hop and not used for caching, therefore it is not listed in Vary.
Overview table
- Name
- TE
- Description
- Lists transfer codings supported by the user-agent.
- Direction
- Request
- Negotiates
- Transfer-Encoding
- Specification
- RFC 7230: HTTP/1.1 Message Syntax and Routing ยง4.3. TE
Syntax
TE = #t-codings
t-codings = "trailers" / ( transfer-coding [ t-ranking ] )
t-ranking = OWS ";" OWS "q=" rank
rank = ( "0" [ "." 0*3DIGIT ] )
/ ( "1" [ "." 0*3("0") ] )
Example
A client that supports the "deflate" transfer coding, and the "chunked" transfer coding (without trailers):
TE: deflate
A client that only supports the "chunked" transfer coding (without trailers):
TE:
A client that supports the "chunked" transfer coding (including trailers), and supports "deflate" with a reduced preference:
TE: trailers, deflate;q=0.5