|
||||||||||
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()
Deprecated. (4.3) use DefaultHttpRequestFactory |
StatusLine |
getStatusLine()
Obtains the status line of this response. |
void |
setEntity(HttpEntity entity)
Associates a response entity with this response. |
void |
setLocale(Locale loc)
Deprecated. (4.3) use DefaultHttpRequestFactory |
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 responsevoid setStatusLine(ProtocolVersion ver, int code)
locale
.
ver
- the HTTP versioncode
- the status codevoid setStatusLine(ProtocolVersion ver, int code, String reason)
ver
- the HTTP versioncode
- the status codereason
- the reason phrase, or null
to omitvoid 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)
HttpEntity.isStreaming()
returns true
),
it must be fully consumed in order to ensure release of resources.
entity
- the entity to associate with this response, or
null
to unsetHttpEntity.isStreaming()
,
EntityUtils.updateEntity(HttpResponse, HttpEntity)
@Deprecated Locale getLocale()
DefaultHttpRequestFactory
status code
.
It can be changed using setLocale
.
null
@Deprecated void setLocale(Locale loc)
DefaultHttpRequestFactory
loc
- the new locale
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |