The Transfer-Encoding header specifies the form of encoding used to safely transfer the payload body to the user.
Note: HTTP/2 disallows all uses of the Transfer-Encoding header other than the HTTP/2 specific: "trailers". HTTP 2 provides its own more efficient mechanisms for data streaming than chunked transfer and forbids the use of the header. Usage of the header in HTTP/2 may likely result in a specific protocol error as HTTP/2 Protocol prohibits the use.
Transfer-Encoding is a hop-by-hop header, that is applied to a message between two nodes, not to a resource itself. Each segment of a multi-node connection can use different Transfer-Encoding values. If you want to compress data over the whole connection, use the end-to-end Content-Encoding header instead.
When present on a response to a HEAD request that has no body, it indicates the value that would have applied to the corresponding GET message.
| Header type | Request header, Response header, Payload header |
|---|---|
| Forbidden header name | yes |