Trailer - HTTP 编辑
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 |
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.,
Transfer-Encoding
andContent-Length
), - routing headers (e.g.,
Host
), - request modifiers (e.g., controls and conditionals, like
Cache-Control
,Max-Forwards
, orTE
), - authentication headers (e.g.,
Authorization
orSet-Cookie
), - or
Content-Encoding
,Content-Type
,Content-Range
, andTrailer
itself.
- message framing headers (e.g.,
Examples
Chunked transfer encoding using a trailing header
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
Specifications
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 |
Browser compatibility
BCD tables only load in the browser
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 and send us a pull request.
See also
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论