com.bitmechanic.maxq
Class HttpRequestHeader

java.lang.Object
  extended by com.bitmechanic.maxq.HttpRequestHeader

public class HttpRequestHeader
extends java.lang.Object

Parses and stores a http server request. Originally posted to comp.lang.java in 1996.

Author:
Sherman Janes

Field Summary
 java.lang.String accept
          A list of mime types the client can accept.
 java.lang.String authorization
          The clients authorization.
 int contentLength
          The length of the content following the header.
 java.lang.String contentType
          The type of content following the request header.
 java.lang.String ifModifiedSince
          A internet address date of the remote copy.
 java.lang.String method
          Http Request method.
 int oldContentLength
          The content length of a remote copy of the requested object.
 boolean pragmaNoCache
          Indicates that no cached versions of the requested object are to be sent.
 java.lang.String referer
          The requesting documents that contained the url link.
 java.lang.String unrecognized
          Anything in the header that was unrecognized by this class.
 java.lang.String url
          The requested url.
 java.lang.String userAgent
          The client's browser's name.
 java.lang.String version
          Version of http being used.
 
Constructor Summary
HttpRequestHeader(java.io.InputStream in)
          Parses a http header from a stream.
 
Method Summary
 java.lang.String toString()
          (Re)builds the header in a string.
 java.lang.String toString(boolean sendUnknowen)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

method

public java.lang.String method
Http Request method. Such as get or post.


url

public java.lang.String url
The requested url. The universal resource locator that hopefully uniquely describes the object or service the client is requesting.


version

public java.lang.String version
Version of http being used. Such as HTTP/1.0


userAgent

public java.lang.String userAgent
The client's browser's name.


referer

public java.lang.String referer
The requesting documents that contained the url link.


ifModifiedSince

public java.lang.String ifModifiedSince
A internet address date of the remote copy.


accept

public java.lang.String accept
A list of mime types the client can accept.


authorization

public java.lang.String authorization
The clients authorization. Don't belive it.


contentType

public java.lang.String contentType
The type of content following the request header. Normally there is no content and this is blank, however the post method usually does have a content and a content length.


contentLength

public int contentLength
The length of the content following the header. Usually blank.


oldContentLength

public int oldContentLength
The content length of a remote copy of the requested object.


unrecognized

public java.lang.String unrecognized
Anything in the header that was unrecognized by this class.


pragmaNoCache

public boolean pragmaNoCache
Indicates that no cached versions of the requested object are to be sent. Usually used to tell proxy not to send a cached copy. This may also effect servers that are front end for data bases.

Constructor Detail

HttpRequestHeader

public HttpRequestHeader(java.io.InputStream in)
                  throws java.io.IOException
Parses a http header from a stream.

Parameters:
in - The stream to parse.
Throws:
java.io.IOException
Method Detail

toString

public java.lang.String toString(boolean sendUnknowen)

toString

public java.lang.String toString()
(Re)builds the header in a string.

Overrides:
toString in class java.lang.Object
Returns:
The header in a string.