The Trailer response 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 TE
request header needs to be set to "trailers" to allow trailer fields.
Header type | Response header |
---|---|
Forbidden header name | yes |
Trailer: header-names
header-names
Transfer-Encoding
and Content-Length
),Host
),Cache-Control
, Max-Forwards
, or TE
), Authorization
or Set-Cookie
),Content-Encoding
, Content-Type
, Content-Range
, and Trailer
itself.In this example, the Expires
header is used at the end of the chunked message and serves as a trailing header.
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 Expires: Wed, 21 Oct 2015 07:28:00 GMT\r\n \r\n
Specification | Title |
---|---|
RFC 7230, section 4.4: Trailer | Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |
RFC 7230, section 4.1.2: Chunked trailer part | Hypertext Transfer Protocol (HTTP/1.1): Message Syntax and Routing |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | Yes | Yes | Yes | Yes | Yes |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Trailer