public class HttpResponseHeader
extends java.lang.Object
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 and Description |
---|
HttpResponseHeader(java.io.InputStream stream)
Deprecated.
Create an HTTP response header object by reading its contents from an input stream.
|
Modifier and Type | Method and Description |
---|---|
int | getBodySize()
Deprecated.
Return the size (in bytes) of the body or -1 if not determinable (body may not exist)
|
int | getByteCountReceived()
Deprecated.
Returns the number of bytes received from the socket connection with the server that made up this response
|
java.util.Hashtable | getHeaderFields()
Deprecated.
Returns a hashtable of header fields and values from the HTTP response.
|
java.lang.String | getProtocol()
Deprecated.
Returns the protocol field from the HTTP status line (example: "HTTP")
|
java.lang.String | getReasonPhrase()
Deprecated.
Returns the reason phrase field from the HTTP status line (example: "Unauthorized")
|
java.lang.String | getStatusCode()
Deprecated.
Returns the status code field from the HTTP status line (example: "401")
|
java.lang.String | toString()
Deprecated.
Returns a string representation of this object.
|
public HttpResponseHeader(java.io.InputStream stream) throws java.io.IOException
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()