|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.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.
| Constructor Summary | |
BasicHttpResponse(HttpVersion ver,
int code,
java.lang.String reason)
Creates a response from elements of a status line. |
|
BasicHttpResponse(StatusLine statusline)
Creates a response from a status line. |
|
BasicHttpResponse(StatusLine statusline,
ReasonPhraseCatalog catalog,
java.util.Locale locale)
Creates a new response. |
|
| Method Summary | |
HttpEntity |
getEntity()
Obtains the message entity of this response, if any. |
HttpVersion |
getHttpVersion()
Returns the HTTP version this message is compatible with. |
java.util.Locale |
getLocale()
Obtains the locale of this response. |
protected java.lang.String |
getReason(int code)
Looks up a reason phrase. |
StatusLine |
getStatusLine()
Obtains the status line of this response. |
void |
setEntity(HttpEntity entity)
Associates a response entity with this response. |
void |
setLocale(java.util.Locale loc)
Changes the locale of this response. |
void |
setReasonPhrase(java.lang.String reason)
Updates the status line of this response with a new reason phrase. |
void |
setStatusCode(int code)
Updates the status line of this response with a new status code. |
void |
setStatusLine(HttpVersion ver,
int code)
Sets the status line of this response. |
void |
setStatusLine(HttpVersion ver,
int code,
java.lang.String reason)
Sets the status line of this response with a reason phrase. |
void |
setStatusLine(StatusLine statusline)
Sets the status line of this response. |
| Methods inherited from class org.apache.http.message.AbstractHttpMessage |
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.apache.http.HttpMessage |
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams |
| Constructor Detail |
public BasicHttpResponse(StatusLine statusline,
ReasonPhraseCatalog catalog,
java.util.Locale locale)
statusline - the status linecatalog - the reason phrase catalog, or
null to disable automatic
reason phrase lookuplocale - the locale for looking up reason phrases, or
null for the system localepublic BasicHttpResponse(StatusLine statusline)
statusline - the status line
public BasicHttpResponse(HttpVersion ver,
int code,
java.lang.String reason)
ver - the HTTP version of the responsecode - the status code of the responsereason - the reason phrase to the status code, or
null| Method Detail |
public HttpVersion getHttpVersion()
HttpMessage
getHttpVersion in interface HttpMessagepublic StatusLine getStatusLine()
HttpResponsesetStatusLine methods,
or it can be initialized in a constructor.
getStatusLine in interface HttpResponsenull if not yet setpublic HttpEntity getEntity()
HttpResponsesetEntity.
getEntity in interface HttpResponsenull if there is nonepublic java.util.Locale getLocale()
HttpResponsestatus code.
It can be changed using setLocale.
getLocale in interface HttpResponsenullpublic void setStatusLine(StatusLine statusline)
HttpResponse
setStatusLine in interface HttpResponsestatusline - the status line of this response
public void setStatusLine(HttpVersion ver,
int code)
HttpResponselocale.
setStatusLine in interface HttpResponsever - the HTTP versioncode - the status code
public void setStatusLine(HttpVersion ver,
int code,
java.lang.String reason)
HttpResponse
setStatusLine in interface HttpResponsever - the HTTP versioncode - the status codereason - the reason phrase, or null to omitpublic void setStatusCode(int code)
HttpResponselocale. It can be set
explicitly using setReasonPhrase.
setStatusCode in interface HttpResponsecode - the HTTP status code.HttpStatus,
HttpResponse.setStatusLine(StatusLine),
HttpResponse.setStatusLine(HttpVersion,int)public void setReasonPhrase(java.lang.String reason)
HttpResponse
setReasonPhrase in interface HttpResponsereason - the new reason phrase as a single-line string, or
null to unset the reason phraseHttpResponse.setStatusLine(StatusLine),
HttpResponse.setStatusLine(HttpVersion,int)public void setEntity(HttpEntity entity)
HttpResponse
setEntity in interface HttpResponseentity - the entity to associate with this response, or
null to unsetpublic void setLocale(java.util.Locale loc)
HttpResponse
setLocale in interface HttpResponseloc - the new localegetLocale,
setStatusCodeprotected java.lang.String getReason(int code)
code - the status code for which to look up the reason
null if there is none
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||