gnu.inet.http

Class Response


public class Response
extends java.lang.Object

An HTTP response.

Author:
Chris Burdess

Field Summary

protected int
code
The HTTP status code of the response.
protected int
codeClass
The class of the response.
protected Headers
headers
The response headers.
protected int
majorVersion
The HTTP major version of the server issuing the response.
protected java.lang.String
message
Human-readable text of the response.
protected int
minorVersion
The HTTP minor version of the server issuing the response.

Constructor Summary

Response(int majorVersion, int minorVersion, int code, int codeClass, java.lang.String message, Headers headers)
Constructs a new response with the specified parameters.

Method Summary

int
getCode()
Returns the HTTP status code of the response.
int
getCodeClass()
Returns the class of the response.
java.util.Date
getDateHeader(java.lang.String name)
Returns the header value for the specified name as a date.
java.lang.String
getHeader(java.lang.String name)
Returns the header value for the specified name.
Headers
getHeaders()
Returns the headers in the response.
int
getIntHeader(java.lang.String name)
Returns the header value for the specified name as an integer.
int
getMajorVersion()
Returns the HTTP major version of the server issuing the response.
java.lang.String
getMessage()
Returns the human-readable text of the response.
int
getMinorVersion()
Returns the HTTP minor version of the server issuing the response.

Field Details

code

protected final int code
The HTTP status code of the response.


codeClass

protected final int codeClass
The class of the response. This is the most significant digit of the status code.
1xx
Informational response
2xx
Success
3xx
Redirection
4xx
Client error
5xx
Server error


headers

protected final Headers headers
The response headers.


majorVersion

protected final int majorVersion
The HTTP major version of the server issuing the response.


message

protected final java.lang.String message
Human-readable text of the response.


minorVersion

protected final int minorVersion
The HTTP minor version of the server issuing the response.

Constructor Details

Response

protected Response(int majorVersion,
                   int minorVersion,
                   int code,
                   int codeClass,
                   java.lang.String message,
                   Headers headers)
Constructs a new response with the specified parameters.

Method Details

getCode

public int getCode()
Returns the HTTP status code of the response.

See Also:
code


getCodeClass

public int getCodeClass()
Returns the class of the response.

See Also:
codeClass


getDateHeader

public java.util.Date getDateHeader(java.lang.String name)
Returns the header value for the specified name as a date.

Parameters:
name - the header name


getHeader

public java.lang.String getHeader(java.lang.String name)
Returns the header value for the specified name.

Parameters:
name - the header name


getHeaders

public Headers getHeaders()
Returns the headers in the response.


getIntHeader

public int getIntHeader(java.lang.String name)
Returns the header value for the specified name as an integer.

Parameters:
name - the header name


getMajorVersion

public int getMajorVersion()
Returns the HTTP major version of the server issuing the response.

See Also:
majorVersion


getMessage

public java.lang.String getMessage()
Returns the human-readable text of the response.

See Also:
message


getMinorVersion

public int getMinorVersion()
Returns the HTTP minor version of the server issuing the response.

See Also:
minorVersion


© Copyright 2003 The Free Software Foundation, all rights reserved