{{HTTPSidebar}}
The Trailer request header allows the sender to include additional fields at the end of chunked messages in order to supply metadata that might be dynamically generated while the message body is sent, such as a message integrity check, digital signature, or post-processing status.
The {{HTTPHeader("TE")}} request header needs to be set to "trailers" to allow trailer fields.
Header type | {{Glossary("Response header")}} |
---|---|
{{Glossary("Forbidden header name")}} | no |
Syntax
Trailer: header-names
Directives
header-names
- HTTP header fields which will be present in the trailer part of chunked messages. These header fields are disallowed:
- message framing headers (e.g., {{HTTPHeader("Transfer-Encoding")}} and {{HTTPHeader("Content-Length")}}),
- routing headers (e.g., {{HTTPHeader("Host")}}),
- request modifiers (e.g., controls and conditionals, like {{HTTPHeader("Cache-Control")}}, {{HTTPHeader("Max-Forwards")}}, or {{HTTPHeader("TE")}}),
- authentication headers (e.g., {{HTTPHeader("Authorization")}} or {{HTTPHeader("Set-Cookie")}}),
- or {{HTTPHeader("Content-Encoding")}}, {{HTTPHeader("Content-Type")}}, {{HTTPHeader("Content-Range")}}, and
Trailer
itself.
Examples
Chunked transfer encoding using a trailer
HTTP/1.1 200 OK Content-Type: text/plain Transfer-Encoding: chunked Trailer: Expires 7\r\n Mozilla\r\n 9\r\n Developer\r\n 7\r\n Network\r\n 0\r\n \r\n Expires: Wed, 21 Oct 2015 07:28:00 GMT
Specifications
Specification | Title |
---|---|
{{RFC("7230", "Trailer", "4.4")}} | Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |
{{RFC("7230", "Chunked trailer part", "4.1.2")}} | Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |
Browser compatibility
The compatibility table in this page is generated from structured data. If you’d like to contribute to the data, please check out https://github.com/mdn/browser-compat-data/README.md and send us a pull request
{{Compat}}
See also
- {{HTTPHeader("Transfer-Encoding")}}
- {{HTTPHeader("TE")}}