|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface HttpResponse
After receiving and interpreting a request message, a server responds with an HTTP response message.
Response = Status-Line
*(( general-header
| response-header
| entity-header ) CRLF)
CRLF
[ message-body ]
| Method Summary | |
|---|---|
HttpEntity |
getEntity()
Obtains the message entity of this response, if any. |
Locale |
getLocale()
Obtains the locale of this response. |
StatusLine |
getStatusLine()
Obtains the status line of this response. |
void |
setEntity(HttpEntity entity)
Associates a response entity with this response. |
void |
setLocale(Locale loc)
Changes the locale of this response. |
void |
setReasonPhrase(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(ProtocolVersion ver,
int code)
Sets the status line of this response. |
void |
setStatusLine(ProtocolVersion ver,
int code,
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 interface org.apache.http.HttpMessage |
|---|
addHeader, addHeader, containsHeader, getAllHeaders, getFirstHeader, getHeaders, getLastHeader, getParams, getProtocolVersion, headerIterator, headerIterator, removeHeader, removeHeaders, setHeader, setHeader, setHeaders, setParams |
| Method Detail |
|---|
StatusLine getStatusLine()
setStatusLine methods,
or it can be initialized in a constructor.
null if not yet setvoid setStatusLine(StatusLine statusline)
statusline - the status line of this response
void setStatusLine(ProtocolVersion ver,
int code)
locale.
ver - the HTTP versioncode - the status code
void setStatusLine(ProtocolVersion ver,
int code,
String reason)
ver - the HTTP versioncode - the status codereason - the reason phrase, or null to omit
void setStatusCode(int code)
throws IllegalStateException
locale. It can be set
explicitly using setReasonPhrase.
code - the HTTP status code.
IllegalStateException - if the status line has not be setHttpStatus,
setStatusLine(StatusLine),
setStatusLine(ProtocolVersion,int)
void setReasonPhrase(String reason)
throws IllegalStateException
reason - the new reason phrase as a single-line string, or
null to unset the reason phrase
IllegalStateException - if the status line has not be setsetStatusLine(StatusLine),
setStatusLine(ProtocolVersion,int)HttpEntity getEntity()
setEntity.
null if there is nonevoid setEntity(HttpEntity entity)
entity - the entity to associate with this response, or
null to unsetLocale getLocale()
status code.
It can be changed using setLocale.
nullvoid setLocale(Locale loc)
loc - the new localegetLocale,
setStatusCode
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||