public class HttpResponse extends HttpMessage
| Modifier and Type | Field and Description |
|---|---|
private String |
reasonPhrase |
static int |
STATUS_CODE_ACCEPTED
The
status-code for Accepted. |
static int |
STATUS_CODE_BAD_GATEWAY
The
status-code for Bad Gateway. |
static int |
STATUS_CODE_BAD_REQUEST
The
status-code for Bad Request. |
static int |
STATUS_CODE_CONFLICT
The
status-code for Conflict. |
static int |
STATUS_CODE_CONTINUE
The
status-code for Continue. |
static int |
STATUS_CODE_CREATED
The
status-code for Created. |
static int |
STATUS_CODE_EXPECTATION_FAILED
The
status-code for Expectation Failed. |
static int |
STATUS_CODE_FORBIDDEN
The
status-code for Forbidden. |
static int |
STATUS_CODE_GATEWAY_TIMEOUT
The
status-code for Gateway Timeout. |
static int |
STATUS_CODE_GONE
The
status-code for Gone. |
static int |
STATUS_CODE_HTTP_VERSION_NOT_SUPPORTED
The
status-code for HTTP Version Not Supported. |
static int |
STATUS_CODE_INTERNAL_SERVER_ERROR
The
status-code for Internal Server Error. |
static int |
STATUS_CODE_LENGTH_REQUIRED
The
status-code for Length Required. |
static int |
STATUS_CODE_METHOD_NOT_ALLOWED
The
status-code for Not Allowed. |
static int |
STATUS_CODE_MOVED_PERMANENTLY
The
status-code for Moved Permanently. |
static int |
STATUS_CODE_MOVED_TEMPORARILY
The
status-code for Moved Temporary. |
static int |
STATUS_CODE_MULTIPLE_CHOICES
The
status-code for Multiple Choices. |
static int |
STATUS_CODE_NO_CONTENT
The
status-code for No Content. |
static int |
STATUS_CODE_NONAUTHORITATIVE_INFORMATION
The
status-code for Non-Authoritative Information. |
static int |
STATUS_CODE_NOT_ACCEPTABLE
The
status-code for Not Acceptable. |
static int |
STATUS_CODE_NOT_FOUND
The
status-code for Not Found. |
static int |
STATUS_CODE_NOT_IMPLEMENTED
The
status-code for Not Implemented. |
static int |
STATUS_CODE_NOT_MODIFIED
The
status-code for Not Modified. |
static int |
STATUS_CODE_OK
The
status-code for OK. |
static int |
STATUS_CODE_PARTIAL_CONTENT
The
status-code for Partial Content. |
static int |
STATUS_CODE_PAYMENT_REQUIRED
The
status-code for Payment Required. |
static int |
STATUS_CODE_PRECONDITION_FAILED
The
status-code for Precondition Failed. |
static int |
STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED
The
status-code for Proxy Authentication Required. |
static int |
STATUS_CODE_REQUEST_ENTITY_TOO_LARGE
The
status-code for Request Entity Too Large. |
static int |
STATUS_CODE_REQUEST_RANGE_NOT_SATISFIABLE
The
status-code for Request Range Not Satisfiable. |
static int |
STATUS_CODE_REQUEST_TIMEOUT
The
status-code for Request Timeout. |
static int |
STATUS_CODE_REQUEST_URI_TOO_LONG
The
status-code for Request URI Too Long. |
static int |
STATUS_CODE_RESET_CONTENT
The
status-code for Reset Content. |
static int |
STATUS_CODE_SEE_OTHER
The
status-code for See other. |
static int |
STATUS_CODE_SERVICE_UNAVAILABLE
The
status-code for Service Unavailable. |
static int |
STATUS_CODE_SWITCHING_PROTOCOLS
The
status-code for Switching Protocols. |
static int |
STATUS_CODE_TEMPORARY_REDIRECT
The
status-code for Temporary Redirect. |
static int |
STATUS_CODE_UNAUTHORIZED
The
status-code for Unauthorized. |
static int |
STATUS_CODE_UNSUPPORTED_MEDIA_TYPE
The
status-code for Unsupported Media Type. |
static int |
STATUS_CODE_USE_PROXY
The
status-code for Use Proxy. |
private int |
statusCode |
CHAR_FILTER_BLACKLIST_COMMA_OR_SEMICOLON, CHAR_FILTER_WHITELIST_COMMA_OR_SEMICOLON, CRLF, HEADER_ATTRIBUTE_MAX_AGE, HEADER_PROPERTY_CACHE_CONTROL, HEADER_PROPERTY_CONTENT_ENCODING, HEADER_PROPERTY_CONTENT_LENGTH, HEADER_PROPERTY_CONTENT_TYPE, HEADER_PROPERTY_DATE, HEADER_PROPERTY_EXPIRES, HEADER_PROPERTY_FROM, HEADER_PROPERTY_HOST, HEADER_PROPERTY_IF_MODIFIED_SINCE, HEADER_PROPERTY_LAST_MODIFIED, HEADER_PROPERTY_LOCATION, HEADER_PROPERTY_PRAGMA, HEADER_PROPERTY_REFERER, HEADER_PROPERTY_SERVER, HEADER_PROPERTY_USER_AGENT, HEADER_PROPERTY_WWW_AUTHENTICATE, VERSION_0_9, VERSION_1_0, VERSION_1_1, VERSION_PREFIX| Constructor and Description |
|---|
HttpResponse()
The constructor.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getReasonPhrase()
This method gets the reason-phrase explaining the
status-code. |
int |
getStatusCode()
This method gets the HTTP status code.
|
void |
setReasonPhrase(String reason)
This method sets the reason-phrase.
|
void |
setStatusCode(int httpStatusCode)
This method sets the HTTP status code.
|
protected void |
writeFirstLine(StringBuffer buffer)
This method writes the first line (request-line or status-line) of the HTTP message.
|
appendHeaderProperty, appendHeaderProperty, createHeaderNameHash, getCacheControlMaxAge, getContentEncoding, getContentLength, getContentType, getDate, getHeaderProperty, getHeaderPropertyAttribute, getVersion, serialize, setCacheControlMaxAge, setContentEncoding, setContentLength, setContentType, setDate, setHeaderProperty, setHeaderPropertyAttribute, setVersion, toStringpublic static final int STATUS_CODE_CONTINUE
status-code for Continue.public static final int STATUS_CODE_SWITCHING_PROTOCOLS
status-code for Switching Protocols.public static final int STATUS_CODE_OK
status-code for OK.public static final int STATUS_CODE_CREATED
status-code for Created.public static final int STATUS_CODE_ACCEPTED
status-code for Accepted.public static final int STATUS_CODE_NONAUTHORITATIVE_INFORMATION
status-code for Non-Authoritative Information.public static final int STATUS_CODE_NO_CONTENT
status-code for No Content.public static final int STATUS_CODE_RESET_CONTENT
status-code for Reset Content.public static final int STATUS_CODE_PARTIAL_CONTENT
status-code for Partial Content.public static final int STATUS_CODE_MULTIPLE_CHOICES
status-code for Multiple Choices.public static final int STATUS_CODE_MOVED_PERMANENTLY
status-code for Moved Permanently.public static final int STATUS_CODE_MOVED_TEMPORARILY
status-code for Moved Temporary.public static final int STATUS_CODE_SEE_OTHER
status-code for See other.public static final int STATUS_CODE_NOT_MODIFIED
status-code for Not Modified.public static final int STATUS_CODE_USE_PROXY
status-code for Use Proxy.public static final int STATUS_CODE_TEMPORARY_REDIRECT
status-code for Temporary Redirect.public static final int STATUS_CODE_BAD_REQUEST
status-code for Bad Request.public static final int STATUS_CODE_UNAUTHORIZED
status-code for Unauthorized.public static final int STATUS_CODE_PAYMENT_REQUIRED
status-code for Payment Required.public static final int STATUS_CODE_FORBIDDEN
status-code for Forbidden.public static final int STATUS_CODE_NOT_FOUND
status-code for Not Found.public static final int STATUS_CODE_METHOD_NOT_ALLOWED
status-code for Not Allowed.public static final int STATUS_CODE_NOT_ACCEPTABLE
status-code for Not Acceptable.public static final int STATUS_CODE_PROXY_AUTHENTICATION_REQUIRED
status-code for Proxy Authentication Required.public static final int STATUS_CODE_REQUEST_TIMEOUT
status-code for Request Timeout.public static final int STATUS_CODE_CONFLICT
status-code for Conflict.public static final int STATUS_CODE_GONE
status-code for Gone.public static final int STATUS_CODE_LENGTH_REQUIRED
status-code for Length Required.public static final int STATUS_CODE_PRECONDITION_FAILED
status-code for Precondition Failed.public static final int STATUS_CODE_REQUEST_ENTITY_TOO_LARGE
status-code for Request Entity Too Large.public static final int STATUS_CODE_REQUEST_URI_TOO_LONG
status-code for Request URI Too Long.public static final int STATUS_CODE_UNSUPPORTED_MEDIA_TYPE
status-code for Unsupported Media Type.public static final int STATUS_CODE_REQUEST_RANGE_NOT_SATISFIABLE
status-code for Request Range Not Satisfiable.public static final int STATUS_CODE_EXPECTATION_FAILED
status-code for Expectation Failed.public static final int STATUS_CODE_INTERNAL_SERVER_ERROR
status-code for Internal Server Error.public static final int STATUS_CODE_NOT_IMPLEMENTED
status-code for Not Implemented.public static final int STATUS_CODE_BAD_GATEWAY
status-code for Bad Gateway.public static final int STATUS_CODE_SERVICE_UNAVAILABLE
status-code for Service Unavailable.public static final int STATUS_CODE_GATEWAY_TIMEOUT
status-code for Gateway Timeout.public static final int STATUS_CODE_HTTP_VERSION_NOT_SUPPORTED
status-code for HTTP Version Not Supported.private int statusCode
private String reasonPhrase
public int getStatusCode()
public void setStatusCode(int httpStatusCode)
httpStatusCode - the HTTP statusCode to set.getStatusCode()public String getReasonPhrase()
status-code.public void setReasonPhrase(String reason)
reason - the reason-phrase to set.getReasonPhrase()protected void writeFirstLine(StringBuffer buffer)
HttpMessagewriteFirstLine in class HttpMessagebuffer - is the string-buffer where to append the first line.Copyright © 2001–2016 mmm-Team. All rights reserved.