August 30th, 2024

HTTP Trailer Header

The Trailer header in HTTP enables additional metadata in chunked messages, requiring the TE request header to be set to "trailers," while prohibiting certain headers like authentication and content-related ones.

Read original articleLink Icon
HTTP Trailer Header

The Trailer response header in HTTP allows the sender to include additional fields at the end of chunked messages, providing metadata that may be generated dynamically during the transmission of the message body. This can include elements such as message integrity checks or digital signatures. To utilize trailer fields, the TE request header must be set to "trailers." The syntax for the Trailer header is defined as "httpTrailer: header-names," where header-names are the HTTP header fields that will appear in the trailer of chunked messages. Certain headers are prohibited from being included in the trailer, such as message framing headers (e.g., Transfer-Encoding), routing headers (e.g., Host), authentication headers (e.g., Authorization), and specific content-related headers (e.g., Content-Encoding, Content-Type). An example of using the Trailer header is provided, demonstrating how the Expires header can be included at the end of a chunked message.

- The Trailer header allows for additional metadata in chunked HTTP messages.

- The TE request header must be set to "trailers" to use trailer fields.

- Certain headers are disallowed in the trailer, including authentication and content-related headers.

- An example illustrates the use of the Trailer header with the Expires header.

Link Icon 0 comments