Trailer Header

Table of Content

The Trailer Header in HTTP/2 communication is applied at the end of the message with additional fields. These fields are typically used to supply optional metadata about the original (i.e., main) message. The Trailer header allows those fields to be sent after the main message body to not slow the real-time processing of the main message.

Syntax

Trailer: field-name

Directives

The directives for the Trailer header include specifying at least one header field name. These specified fields should not include any non-trailers, content-related fields, transfer-related fields, or conditional-request fields.

Examples

Here is an example of how the Trailer header is implemented:

POST /item HTTP/1.1
Trailer: Max-Forwards
Max-Forwards: 34

Browser Compatibility

Browser Compatibility
Chrome Not Supported
Firefox Not Supported
Safari Not Supported
Opera Not Supported
Edge Not Supported

The Trailer header is unsupported in standard web browsers due to security reasons.

How to modify Trailer header

ModHeader is a chrome extension that allows you to modify the request and response headers, including the Trailer header. However, you must note that the browser's native network stack will disregard this header.

To use ModHeader, follow these steps:

  1. Install ModHeader from the Chrome Web Store.
  2. Open ModHeader.
  3. In the "Response headers" section, add a new header.
  4. Name it "Trailer" and set its value as you wish.
  5. Make your request. The Trailer header will be part of the response headers, notwithstanding that the browser will disregard it.

This specific utility can aid in learning, debugging, and testing different HTTP interactions.