Class HTTPRequest

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class HTTPRequest
    extends Inventor
    implements java.lang.Cloneable
    This class encapsulates an HTTP request message received by the service.
    • Constructor Summary

      Constructors 
      Constructor Description
      HTTPRequest()
      Creates a GET / HTTP/1.1 HTTP request.
      HTTPRequest​(HTTPRequest obj)
      Copy constructor.
      HTTPRequest​(java.lang.String method, java.lang.String uri, int versionMajor, int versionMinor)
      Creates a HTTP request with the given method, URI (Uniform Resource Identifier) and version.
      HTTPRequest​(java.lang.String method, java.lang.String uri, int versionMajor, int versionMinor, HTTPHeaders headers)
      Creates a HTTP request with the given method, URI (Uniform Resource Identifier), version and headers.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Object clone()  
      long getContentLength()
      Returns the value of the Content-Length header field.
      java.lang.String getContentType()
      Returns the value of the Content-Type header field.
      HTTPHeaders getHeaders()
      Returns HTTP headers.
      java.lang.String getHost()
      Returns the value of the Host header field.
      java.lang.String getMethod()
      Returns the request method ("GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATH").
      Uri getURI()
      Returns the URI (Uniform Resource Identifier) being requested.
      java.lang.String getVersion()
      Returns the HTTP version for incoming request (example "HTTP/1.1").
      int getVersionMajor()
      HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol.
      int getVersionMinor()
      HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol.
      void setValue​(HTTPRequest copyFrom)  
      static HTTPRequest[] toArray​(long nativeArray, long length)  
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HTTPRequest

        public HTTPRequest()
        Creates a GET / HTTP/1.1 HTTP request.
      • HTTPRequest

        public HTTPRequest​(HTTPRequest obj)
        Copy constructor.
      • HTTPRequest

        public HTTPRequest​(java.lang.String method,
                           java.lang.String uri,
                           int versionMajor,
                           int versionMinor)
        Creates a HTTP request with the given method, URI (Uniform Resource Identifier) and version.
      • HTTPRequest

        public HTTPRequest​(java.lang.String method,
                           java.lang.String uri,
                           int versionMajor,
                           int versionMinor,
                           HTTPHeaders headers)
        Creates a HTTP request with the given method, URI (Uniform Resource Identifier), version and headers.
    • Method Detail

      • clone

        public java.lang.Object clone()
      • getURI

        public Uri getURI()
        Returns the URI (Uniform Resource Identifier) being requested.
      • setValue

        public void setValue​(HTTPRequest copyFrom)
      • getContentType

        public java.lang.String getContentType()
        Returns the value of the Content-Type header field.
      • toArray

        public static HTTPRequest[] toArray​(long nativeArray,
                                            long length)
      • getVersion

        public java.lang.String getVersion()
        Returns the HTTP version for incoming request (example "HTTP/1.1").
      • getMethod

        public java.lang.String getMethod()
        Returns the request method ("GET", "HEAD", "POST", "PUT", "DELETE", "CONNECT", "OPTIONS", "TRACE", "PATH").
      • getHeaders

        public HTTPHeaders getHeaders()
        Returns HTTP headers.
      • getHost

        public java.lang.String getHost()
        Returns the value of the Host header field.
      • getContentLength

        public long getContentLength()
        Returns the value of the Content-Length header field. The value -1 indicates that the length is unknown (Content-Length header is not present).
      • getVersionMinor

        public int getVersionMinor()
        HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol. Returns the version minor.
      • getVersionMajor

        public int getVersionMajor()
        HTTP uses a "major.minor" numbering scheme to indicate versions of the protocol. Returns the version major.