java.lang.Object | ||
↳ | org.apache.http.message.AbstractHttpMessage | |
↳ | org.apache.http.message.BasicHttpResponse |
Basic implementation of an HTTP response that can be modified. This implementation makes sure that there always is a status line.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
org.apache.http.message.AbstractHttpMessage
|
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Creates a new response.
| |||||||||||
Creates a response from a status line.
| |||||||||||
Creates a response from elements of a status line.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Obtains the message entity of this response, if any.
| |||||||||||
Obtains the locale of this response.
| |||||||||||
Returns the protocol version this message is compatible with.
| |||||||||||
Obtains the status line of this response.
| |||||||||||
Associates a response entity with this response.
| |||||||||||
Changes the locale of this response.
| |||||||||||
Updates the status line of this response with a new reason phrase.
| |||||||||||
Updates the status line of this response with a new status code.
| |||||||||||
Sets the status line of this response.
| |||||||||||
Sets the status line of this response.
| |||||||||||
Sets the status line of this response with a reason phrase.
|
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Looks up a reason phrase.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class org.apache.http.message.AbstractHttpMessage
| |||||||||||
From class java.lang.Object
| |||||||||||
From interface org.apache.http.HttpMessage
| |||||||||||
From interface org.apache.http.HttpResponse
|
Creates a new response. This is the constructor to which all others map.
statusline | the status line |
---|---|
catalog | the reason phrase catalog, or
null to disable automatic
reason phrase lookup |
locale | the locale for looking up reason phrases, or
null for the system locale
|
Creates a response from a status line. The response will not have a reason phrase catalog and use the system default locale.
statusline | the status line |
---|
Creates a response from elements of a status line. The response will not have a reason phrase catalog and use the system default locale.
ver | the protocol version of the response |
---|---|
code | the status code of the response |
reason | the reason phrase to the status code, or
null
|
Obtains the message entity of this response, if any. The entity is provided by calling setEntity.
null
if there is none
Obtains the locale of this response. The locale is used to determine the reason phrase for the status code. It can be changed using setLocale.
null
Returns the protocol version this message is compatible with.
Obtains the status line of this response. The status line can be set using one of the setStatusLine methods, or it can be initialized in a constructor.
null
if not yet set
Associates a response entity with this response.
entity | the entity to associate with this response, or
null to unset
|
---|
Changes the locale of this response. If there is a status line, it's reason phrase will be updated according to the status code and new locale.
loc | the new locale |
---|
Updates the status line of this response with a new reason phrase. The status line can only be updated if it is available. It must have been set either explicitly or in a constructor.
reason | the new reason phrase as a single-line string, or
null to unset the reason phrase |
---|
Updates the status line of this response with a new status code.
The status line can only be updated if it is available. It must
have been set either explicitly or in a constructor.
The reason phrase will be updated according to the new status code,
based on the current locale. It can be set
explicitly using setReasonPhrase.
code | the HTTP status code. |
---|
Sets the status line of this response. The reason phrase will be determined based on the current locale.
ver | the HTTP version |
---|---|
code | the status code |
Sets the status line of this response.
statusline | the status line of this response |
---|
Sets the status line of this response with a reason phrase.
ver | the HTTP version |
---|---|
code | the status code |
reason | the reason phrase, or null to omit
|
Looks up a reason phrase. This method evaluates the currently set catalog and locale. It also handles a missing catalog.
code | the status code for which to look up the reason |
---|
null
if there is none