Trailer header

Limited availability

This feature is not Baseline because it does not work in some of the most widely-used browsers.

The HTTP Trailer request and 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.

Note: The TE request header needs to be set to trailers to allow trailer fields.

Warning: Developers cannot access HTTP trailers via the Fetch API or XHR. Additionally, browsers ignore HTTP trailers, with the exception of Server-Timing. See Browser compatibility for more information.

Header type Request header, Response header, Content header
Forbidden request header Yes

Syntax

http
Trailer: header-names

Directives

header-names

HTTP header fields which will be present in the trailer part of chunked messages. The following header names are disallowed:

Examples

Server-Timing as HTTP trailer

Some browsers support showing server timing data in developer tools when the Server-Timing header is sent as a trailer. In the following response, the Trailer header is used to indicate that a Server-Timing header will follow the response body. A metric custom-metric with a duration of 123.4 milliseconds is sent:

http
HTTP/1.1 200 OK
Transfer-Encoding: chunked
Trailer: Server-Timing

--- response body ---
Server-Timing: custom-metric;dur=123.4

Specifications

Specification
HTTP Semantics
# field.trailer
HTTP/1.1
# chunked.trailer.section

Browser compatibility

desktop mobile
Chrome
Edge
Firefox
Opera
Safari
Chrome Android
Firefox for Android
Opera Android
Safari on iOS
Samsung Internet
WebView Android
WebView on iOS
Trailer
Chrome – No support
Chrome
footnote No support
Edge – No support
Edge
footnote No support
Firefox – Partial support
Firefox 71 (Release date: 2019-12-10)
footnote Partial support
footnote Only the Server-Timing header is a recognized trailer, and it is only exposed to DevTools in the network Timing tab (bug 1403051). Developers cannot access trailers via the Fetch API or XHR.
Opera – No support
Opera
footnote No support
Safari – No support
Safari
footnote No support
Chrome Android – No support
Chrome Android
footnote No support
Firefox for Android – Partial support
Firefox for Android 79 (Release date: 2020-07-28)
footnote Partial support
footnote Only the Server-Timing header is a recognized trailer, and it is only exposed to DevTools in the network Timing tab (bug 1403051). Developers cannot access trailers via the Fetch API or XHR.
Opera Android – No support
Opera Android
footnote No support
Safari on iOS – No support
Safari on iOS
footnote No support
Samsung Internet – No support
Samsung Internet
footnote No support
WebView Android – No support
WebView Android
footnote No support
WebView on iOS – No support
WebView on iOS
footnote No support

Legend

Tip: you can click/tap on a cell for more information.

Full support
Full support
Partial support
Partial support
No support
No support

See also