Class DefaultHttpRequest

java.lang.Object
All Implemented Interfaces:
DecoderResultProvider, HttpMessage, HttpObject, HttpRequest
Direct Known Subclasses:
DefaultFullHttpRequest

public class DefaultHttpRequest extends DefaultHttpMessage implements HttpRequest
The default HttpRequest implementation.
  • Field Details

    • HASH_CODE_PRIME

      private static final int HASH_CODE_PRIME
      See Also:
    • method

      private HttpMethod method
    • uri

      private java.lang.String uri
    • validateRequestLine

      private final boolean validateRequestLine
  • Constructor Details

    • DefaultHttpRequest

      public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri)
      Creates a new instance.
      Parameters:
      httpVersion - the HTTP version of the request
      method - the HTTP method of the request
      uri - the URI or path of the request
    • DefaultHttpRequest

      @Deprecated public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, boolean validateHeaders)
      Deprecated.
      Prefer the DefaultHttpRequest(HttpVersion, HttpMethod, String) constructor instead, to always have header validation enabled.
      Creates a new instance.
      Parameters:
      httpVersion - the HTTP version of the request
      method - the HTTP method of the request
      uri - the URI or path of the request
      validateHeaders - validate the header names and values when adding them to the HttpHeaders
    • DefaultHttpRequest

      public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, HttpHeadersFactory headersFactory)
      Creates a new instance.
      Parameters:
      httpVersion - the HTTP version of the request
      method - the HTTP method of the request
      uri - the URI or path of the request
      headersFactory - the HttpHeadersFactory used to create the headers for this Request. The recommended default is DefaultHttpHeadersFactory.headersFactory().
    • DefaultHttpRequest

      public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, HttpHeaders headers)
      Creates a new instance.
      Parameters:
      httpVersion - the HTTP version of the request
      method - the HTTP method of the request
      uri - the URI or path of the request
      headers - the Headers for this Request
    • DefaultHttpRequest

      public DefaultHttpRequest(HttpVersion httpVersion, HttpMethod method, java.lang.String uri, HttpHeaders headers, boolean validateRequestLine)
      Creates a new instance.
      Parameters:
      httpVersion - the HTTP version of the request
      method - the HTTP method of the request
      uri - the URI or path of the request
      headers - the Headers for this Request
  • Method Details