public class Response extends Object
| Modifier and Type | Field and Description |
|---|---|
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 String |
message
Human-readable text of the response.
|
protected int |
minorVersion
The HTTP minor version of the server issuing the response.
|
| Modifier | Constructor and Description |
|---|---|
protected |
Response(int majorVersion,
int minorVersion,
int code,
int codeClass,
String message,
Headers headers)
Constructs a new response with the specified parameters.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getCode()
Returns the HTTP status code of the response.
|
int |
getCodeClass()
Returns the class of the response.
|
Date |
getDateHeader(String name)
Returns the header value for the specified name as a date.
|
String |
getHeader(String name)
Returns the header value for the specified name.
|
Headers |
getHeaders()
Returns the headers in the response.
|
int |
getIntHeader(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.
|
String |
getMessage()
Returns the human-readable text of the response.
|
int |
getMinorVersion()
Returns the HTTP minor version of the server issuing the response.
|
protected final int majorVersion
protected final int minorVersion
protected final int code
protected final int codeClass
1xx2xx3xx4xx5xxprotected final String message
protected final Headers headers
public int getMajorVersion()
majorVersionpublic int getMinorVersion()
minorVersionpublic int getCode()
codepublic int getCodeClass()
codeClasspublic String getMessage()
messagepublic Headers getHeaders()
public String getHeader(String name)
name - the header namepublic int getIntHeader(String name)
name - the header nameCopyright © 2017. All rights reserved.