Class HttpRequest

  extended by com.flat502.rox.http.HttpMessage
      extended by com.flat502.rox.http.HttpRequest

public class HttpRequest
extends HttpMessage

This class represents an HTTP request and supports streaming that request out to an indicated stream.

Constructor Summary
HttpRequest(java.lang.String method, java.lang.String uri, Encoding encoding)
          Constructs a new instance using a given HTTP method and URI.
Method Summary
protected  void marshalStartLine( os)
          Constructs and returns the HTTP request line for this request.
Methods inherited from class com.flat502.rox.http.HttpMessage
addHeader, formatDate, getHeaderValue, getStartLine, getVersionString, isHeaderSet, marshal, marshal, marshalContent, marshalHeaders, normalizeHeaderName, setContent, setHeader, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public HttpRequest(java.lang.String method,
                   java.lang.String uri,
                   Encoding encoding)
Constructs a new instance using a given HTTP method and URI.

The URI provided is normalized by a call to Utils.normalizeURIPath(String).

method - The HTTP method to use in this request. May not be null.
uri - The URI to include in this request. May not be null.
encoding - An Encoding describing the encoding to use when constructing this message. This also informs the Content-Encoding header value. May be null.
Method Detail


protected void marshalStartLine( os)
Constructs and returns the HTTP request line for this request.

The request line is defined in section 5.1 of RFC 2616 and consists of the following three values delimited by spaces:

  1. The HTTP method set in the constructor.
  2. The request URI set in the constructor.
  3. The HTTP version returned by HttpMessage.getVersionString().

Specified by:
marshalStartLine in class HttpMessage
os - The stream to write the start line to.