Class HttpRequest


  • public class HttpRequest
    extends HttpMessage
    Basic HTTP Request. not optimized for performance. Set fields or parse from input. Handles text content.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String GET  
      static java.lang.String HEAD  
      protected java.lang.String mHttpVers  
      protected java.lang.String mMethod  
      protected java.lang.String mURI  
      static java.lang.String POST  
    • Constructor Summary

      Constructors 
      Constructor Description
      HttpRequest()
      Instantiate a HttpResponse for write to http client.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getHttpVers()
      get http version
      java.lang.String getMethod()
      get method
      java.lang.String getURI()
      get reason phrase
      void parse​(java.io.BufferedReader reader)
      parse a http request from a http client
      void reset()  
      void setMethod​(java.lang.String method)
      set set request method.
      void setURI​(java.lang.String uri)
      set reason phrase.
      void write​(java.io.OutputStreamWriter writer)
      write request to the http client
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • mMethod

        protected java.lang.String mMethod
      • mURI

        protected java.lang.String mURI
      • mHttpVers

        protected java.lang.String mHttpVers
    • Constructor Detail

      • HttpRequest

        public HttpRequest()
        Instantiate a HttpResponse for write to http client.
    • Method Detail

      • setURI

        public void setURI​(java.lang.String uri)
        set reason phrase.
      • write

        public void write​(java.io.OutputStreamWriter writer)
                   throws java.io.IOException
        write request to the http client
        Overrides:
        write in class HttpMessage
        Throws:
        java.io.IOException
      • parse

        public void parse​(java.io.BufferedReader reader)
                   throws java.io.IOException
        parse a http request from a http client
        Overrides:
        parse in class HttpMessage
        Throws:
        java.io.IOException
      • getMethod

        public java.lang.String getMethod()
        get method
      • getURI

        public java.lang.String getURI()
        get reason phrase
      • getHttpVers

        public java.lang.String getHttpVers()
        get http version