java.lang.Objectcom.ibm.etill.framework.clientapi.HttpResponseHeader
The HttpResponseHeader class is used to encapsulate an HTTP protocol response header (but not the HTTP body). This response is typically created from an input stream associated with a TCP socket connection but any input stream containing a proper HTTP protocol response will do.
This class is meant to parse and give access to the very basics of an HTTP protocol response. In that sense it is a "light-weight" class that does little scrutiny of the header fields.
The input stream given on the constructor is used to read the HTTP header of the response. No portion of the optional body is read by this object from the input stream ... so that if there is a body, it can be read immediately following the creation of an object of this class.
Constructor Summary | |
HttpResponseHeader(java.io.InputStream stream) Create an HTTP response header object by reading its contents from an input stream. |
Method Summary | |
int | getBodySize() Return the size (in bytes) of the body or -1 if not determinable (body may not exist) |
int | getByteCountReceived() Returns the number of bytes received from the socket connection with the server that made up this response |
java.util.Hashtable | getHeaderFields() Returns a hashtable of header fields and values from the HTTP response. |
java.lang.String | getProtocol() Returns the protocol field from the HTTP status line (example: "HTTP") |
java.lang.String | getReasonPhrase() Returns the reason phrase field from the HTTP status line (example: "Unauthorized") |
java.lang.String | getStatusCode() Returns the status code field from the HTTP status line (example: "401") |
java.lang.String | toString() Returns a string representation of this object. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public HttpResponseHeader(java.io.InputStream stream) throws java.io.IOException
Method Detail |
public java.lang.String getProtocol()
public java.lang.String getStatusCode()
public java.lang.String getReasonPhrase()
public java.util.Hashtable getHeaderFields()
The hashtable keys are header field names and their mapped values are the associated field values both contained in the HTTP message header.
public int getBodySize()
public int getByteCountReceived()
public java.lang.String toString()
(C) Copyright IBM Corporation 1996, 2005. All Rights Reserved.