Class HttpRequest


  • public class HttpRequest
    extends Object
    Represents a single Client Request to be sent on a HTTP connection
    • Constructor Detail

      • HttpRequest

        public HttpRequest​(String method,
                           String encodedPath)
        Parameters:
        method - http verb to use
        encodedPath - path of the http request
      • HttpRequest

        public HttpRequest​(String method,
                           String encodedPath,
                           HttpHeader[] headers,
                           HttpRequestBodyStream bodyStream)
        Parameters:
        method - http verb to use
        encodedPath - path of the http request
        headers - set of http request headers to include
        bodyStream - (optional) interface to an object that will stream out the request body
    • Method Detail

      • getMethod

        public String getMethod()
      • getEncodedPath

        public String getEncodedPath()
      • setEncodedPath

        public void setEncodedPath​(String encodedPath)
      • getHeadersAsArray

        public HttpHeader[] getHeadersAsArray()
      • addHeader

        public void addHeader​(HttpHeader header)
      • addHeader

        public void addHeader​(String headerName,
                              String headerValue)
      • addHeaders

        public void addHeaders​(HttpHeader[] headers)
      • marshalForJni

        public byte[] marshalForJni()
        Requests are marshalled as follows: each string field is: [4-bytes BE] [variable length bytes specified by the previous field] Each request is then: [method][path][header name-value pairs]
        Returns:
        encoded blob of headers