Class Trailer

All Implemented Interfaces:
Serializable, Cloneable, Header, NameValuePair

@Header("Trailer") public class Trailer extends BasicStringHeader
Represents a parsed Trailer HTTP response header.

The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer coding.

Example

Trailer: Max-Forwards

RFC2616 Specification
The Trailer general field value indicates that the given set of header fields is present in the trailer of a message encoded with chunked transfer-coding.

Trailer = "Trailer" ":" 1#field-name

An HTTP/1.1 message SHOULD include a Trailer header field in a message using chunked transfer-coding with a non-empty trailer. Doing so allows the recipient to know which header fields to expect in the trailer.

If no Trailer header field is present, the trailer SHOULD NOT include any header fields. See section 3.6.1 for restrictions on the use of trailer fields in a "chunked" transfer-coding.

Message header fields listed in the Trailer header field MUST NOT include the following header fields:

  • Transfer-Encoding
  • Content-Length
  • Trailer
See Also:
  • Constructor Details

    • Trailer

      public Trailer(String value)
      Constructor.
      Parameters:
      value - The header value.
      Can be null.
    • Trailer

      public Trailer(Supplier<String> value)
      Constructor with delayed value.

      Header value is re-evaluated on each call to BasicStringHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
  • Method Details

    • of

      public static Trailer of(String value)
      Static creator.
      Parameters:
      value - The header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.
    • of

      public static Trailer of(Supplier<String> value)
      Static creator with delayed value.

      Header value is re-evaluated on each call to BasicStringHeader.getValue().

      Parameters:
      value - The supplier of the header value.
      Can be null.
      Returns:
      A new header bean, or null if the value is null.