Class MetaData

java.lang.Object
org.eclipse.jetty.http.MetaData
All Implemented Interfaces:
Iterable<HttpField>
Direct Known Subclasses:
MetaData.Request, MetaData.Response

public class MetaData extends Object implements Iterable<HttpField>

Immutable common HTTP information for requests and responses.

Specific HTTP request information is captured by MetaData.Request.

Specific HTTP response information is captured by MetaData.Response.

HTTP trailers information is captured by MetaData.

  • Constructor Details

  • Method Details

    • isTunnel

      public static boolean isTunnel(String method, int status)

      Returns whether the given HTTP request method and HTTP response status code identify a successful HTTP CONNECT tunnel.

      Parameters:
      method - the HTTP request method
      status - the HTTP response status code
      Returns:
      whether method and status identify a successful HTTP CONNECT tunnel
    • isRequest

      public boolean isRequest()
      Returns:
      whether this object is a MetaData.Request
    • isResponse

      public boolean isResponse()
      Returns:
      whether this object is a MetaData.Response
    • getHttpVersion

      public HttpVersion getHttpVersion()
      Get the HTTP protocol version.
      Returns:
      the HTTP protocol version
    • getHttpFields

      public HttpFields getHttpFields()
      Get the HTTP headers or HTTP trailers.
      Returns:
      the HTTP headers or HTTP trailers
    • getTrailersSupplier

      public Supplier<HttpFields> getTrailersSupplier()
      Returns:
      a supplier for the HTTP trailers
    • getContentLength

      public long getContentLength()
      Get the length of the content in bytes.
      Returns:
      the length of the content in bytes
    • iterator

      public Iterator<HttpField> iterator()
      Specified by:
      iterator in interface Iterable<HttpField>
    • toString

      public String toString()
      Overrides:
      toString in class Object