HttpResponse.
org.apache.http.impl.DefaultHttpResponseFactory
| Modifier and Type | Field and Description |
|---|---|
| private int | |
| private HttpEntity | |
| private Locale | |
| private final ReasonPhraseCatalog | |
| private String | |
| private StatusLine | |
| private ProtocolVersion |
| Access | Constructor and Description |
|---|---|
| public | BasicHttpResponse(final StatusLine
the status line statusline, final ReasonPhraseCatalog the reason phrase catalog, or
catalog, final Locale null to disable automatic
reason phrase lookupthe locale for looking up reason phrases, or
locale)null for the system localeCreates a new response. |
| public | |
| public | BasicHttpResponse(final ProtocolVersion
the protocol version of the response ver, final int the status code of the response code, final String the reason phrase to the status code, or
reason)nullCreates a response from elements of a status line. |
| Modifier and Type | Method and Description |
|---|---|
| public HttpEntity | getEntity()
Implements org. |
| public Locale | |
| public ProtocolVersion | getProtocolVersion()
Implements org. |
| protected String | Returns: the reason phrase, ornull if there is nonethe status code for which to look up the reason code)Looks up a reason phrase. |
| public StatusLine | getStatusLine()
Implements org. |
| public void | setEntity(final HttpEntity
the entity to associate with this response, or
entity)null to unsetImplements org. |
| public void | setLocale(final Locale
the new locale locale)Implements org. |
| public void | setReasonPhrase(final String
the new reason phrase as a single-line string, or
reason)null to unset the reason phraseImplements org. |
| public void | setStatusCode(final int
the HTTP status code. code)Implements org. |
| public void | setStatusLine(final StatusLine
the status line of this response statusline)Implements org. |
| public void | setStatusLine(final ProtocolVersion
the HTTP version ver, final int the status code code)Implements org. |
| public void | setStatusLine(final ProtocolVersion
the HTTP version ver, final int the status code code, final String the reason phrase, or reason)null to omitImplements org. |
| public String |
| code | back to summary |
|---|---|
| private int code | |
| entity | back to summary |
|---|---|
| private HttpEntity entity | |
| locale | back to summary |
|---|---|
| private Locale locale | |
| reasonCatalog | back to summary |
|---|---|
| private final ReasonPhraseCatalog reasonCatalog | |
| reasonPhrase | back to summary |
|---|---|
| private String reasonPhrase | |
| statusline | back to summary |
|---|---|
| private StatusLine statusline | |
| ver | back to summary |
|---|---|
| private ProtocolVersion ver | |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final StatusLine statusline, final ReasonPhraseCatalog catalog, final Locale locale) Creates a new response. This is the constructor to which all others map.
| |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final StatusLine statusline) Creates a response from a status line. The response will not have a reason phrase catalog and use the system default locale.
| |
| BasicHttpResponse | back to summary |
|---|---|
| public BasicHttpResponse(final ProtocolVersion ver, final int code, final String reason) Creates a response from elements of a status line. The response will not have a reason phrase catalog and use the system default locale.
| |
| getEntity | back to summary |
|---|---|
| public HttpEntity getEntity() Implements org. Doc from org. Obtains the message entity of this response, if any.
The entity is provided by calling
| |
| getLocale | back to summary |
|---|---|
| public Locale getLocale() Implements org. Doc from org. Obtains the locale of this response.
The locale is used to determine the reason phrase
for the | |
| getProtocolVersion | back to summary |
|---|---|
| public ProtocolVersion getProtocolVersion() Implements org. Doc from org. Returns the protocol version this message is compatible with.
| |
| getReason | back to summary |
|---|---|
| protected String getReason(final int code) Looks up a reason phrase. This method evaluates the currently set catalog and locale. It also handles a missing catalog.
| |
| getStatusLine | back to summary |
|---|---|
| public StatusLine getStatusLine() Implements org. Doc from org. Obtains the status line of this response.
The status line can be set using one of the
| |
| setEntity | back to summary |
|---|---|
| public void setEntity(final HttpEntity entity) Implements org. Doc from org. Associates a response entity with this response.
Please note that if an entity has already been set for this response and it depends on
an input stream (
| |
| setLocale | back to summary |
|---|---|
| public void setLocale(final Locale locale) Implements org. Doc from org. Changes the locale of this response. | |
| setReasonPhrase | back to summary |
|---|---|
| public void setReasonPhrase(final String reason) Implements org. Doc from org. Updates the status line of this response with a new reason phrase. | |
| setStatusCode | back to summary |
|---|---|
| public void setStatusCode(final int code) Implements org. Doc from org. Updates the status line of this response with a new status code.
| |
| setStatusLine | back to summary |
|---|---|
| public void setStatusLine(final StatusLine statusline) Implements org. Doc from org. Sets the status line of this response.
| |
| setStatusLine | back to summary |
|---|---|
| public void setStatusLine(final ProtocolVersion ver, final int code) Implements org. Doc from org. Sets the status line of this response.
The reason phrase will be determined based on the current
| |
| setStatusLine | back to summary |
|---|---|
| public void setStatusLine(final ProtocolVersion ver, final int code, final String reason) Implements org. Doc from org. Sets the status line of this response with a reason phrase.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |