public class HttpResponseDecorator extends Object implements org.apache.http.HttpResponse
HttpResponse, which allows for
simplified header access, as well as carrying the auto-parsed response data.
(see HTTPBuilder.parseResponse(HttpResponse, Object)).HttpResponseDecorator.HeadersDecorator| Modifier and Type | Class and Description |
|---|---|
class |
HttpResponseDecorator.HeadersDecorator
This class is returned by
getHeaders(). |
| Constructor and Description |
|---|
HttpResponseDecorator(org.apache.http.HttpResponse base,
HttpContextDecorator context,
Object parsedResponse) |
HttpResponseDecorator(org.apache.http.HttpResponse base,
Object parsedResponse) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(org.apache.http.Header arg0) |
void |
addHeader(String arg0,
String arg1) |
boolean |
containsHeader(String arg0) |
org.apache.http.Header[] |
getAllHeaders() |
String |
getContentType()
Get the content-type for this response.
|
HttpContextDecorator |
getContext()
Get the execution context used during this request
|
Object |
getData()
Return the parsed data from this response body.
|
org.apache.http.HttpEntity |
getEntity() |
org.apache.http.Header |
getFirstHeader(String arg0) |
HttpResponseDecorator.HeadersDecorator |
getHeaders()
Return a
HttpResponseDecorator.HeadersDecorator, which provides a more Groovy API for
accessing response headers. |
org.apache.http.Header[] |
getHeaders(String arg0) |
org.apache.http.Header |
getLastHeader(String arg0) |
Locale |
getLocale() |
org.apache.http.params.HttpParams |
getParams() |
org.apache.http.ProtocolVersion |
getProtocolVersion() |
int |
getStatus()
Get the response status code.
|
org.apache.http.StatusLine |
getStatusLine() |
org.apache.http.HeaderIterator |
headerIterator() |
org.apache.http.HeaderIterator |
headerIterator(String arg0) |
boolean |
isSuccess()
Quickly determine if the request resulted in an error code.
|
void |
removeHeader(org.apache.http.Header arg0) |
void |
removeHeaders(String arg0) |
void |
setEntity(org.apache.http.HttpEntity arg0) |
void |
setHeader(org.apache.http.Header arg0) |
void |
setHeader(String arg0,
String arg1) |
void |
setHeaders(org.apache.http.Header[] arg0) |
void |
setLocale(Locale arg0) |
void |
setParams(org.apache.http.params.HttpParams arg0) |
void |
setReasonPhrase(String arg0) |
void |
setStatusCode(int arg0) |
void |
setStatusLine(org.apache.http.ProtocolVersion arg0,
int arg1) |
void |
setStatusLine(org.apache.http.ProtocolVersion arg0,
int arg1,
String arg2) |
void |
setStatusLine(org.apache.http.StatusLine arg0) |
public HttpResponseDecorator(org.apache.http.HttpResponse base,
Object parsedResponse)
public HttpResponseDecorator(org.apache.http.HttpResponse base,
HttpContextDecorator context,
Object parsedResponse)
public HttpResponseDecorator.HeadersDecorator getHeaders()
HttpResponseDecorator.HeadersDecorator, which provides a more Groovy API for
accessing response headers.public boolean isSuccess()
Status.SUCCESSpublic int getStatus()
StatusLine.getStatusCode()public String getContentType()
HttpResponseContentTypeFinder.findContentType(HttpResponse)public Object getData()
null if the response
does not contain any data.public HttpContextDecorator getContext()
HttpContextExecutionContextpublic org.apache.http.HttpEntity getEntity()
getEntity in interface org.apache.http.HttpResponsepublic Locale getLocale()
getLocale in interface org.apache.http.HttpResponsepublic org.apache.http.StatusLine getStatusLine()
getStatusLine in interface org.apache.http.HttpResponsepublic void setEntity(org.apache.http.HttpEntity arg0)
setEntity in interface org.apache.http.HttpResponsepublic void setLocale(Locale arg0)
setLocale in interface org.apache.http.HttpResponsepublic void setReasonPhrase(String arg0) throws IllegalStateException
setReasonPhrase in interface org.apache.http.HttpResponseIllegalStateExceptionpublic void setStatusCode(int arg0)
throws IllegalStateException
setStatusCode in interface org.apache.http.HttpResponseIllegalStateExceptionpublic void setStatusLine(org.apache.http.StatusLine arg0)
setStatusLine in interface org.apache.http.HttpResponsepublic void setStatusLine(org.apache.http.ProtocolVersion arg0,
int arg1)
setStatusLine in interface org.apache.http.HttpResponsepublic void setStatusLine(org.apache.http.ProtocolVersion arg0,
int arg1,
String arg2)
setStatusLine in interface org.apache.http.HttpResponsepublic void addHeader(org.apache.http.Header arg0)
addHeader in interface org.apache.http.HttpMessagepublic void addHeader(String arg0, String arg1)
addHeader in interface org.apache.http.HttpMessagepublic boolean containsHeader(String arg0)
containsHeader in interface org.apache.http.HttpMessagepublic org.apache.http.Header[] getAllHeaders()
getAllHeaders in interface org.apache.http.HttpMessagepublic org.apache.http.Header getFirstHeader(String arg0)
getFirstHeader in interface org.apache.http.HttpMessagepublic org.apache.http.Header[] getHeaders(String arg0)
getHeaders in interface org.apache.http.HttpMessagepublic org.apache.http.Header getLastHeader(String arg0)
getLastHeader in interface org.apache.http.HttpMessagepublic org.apache.http.params.HttpParams getParams()
getParams in interface org.apache.http.HttpMessagepublic org.apache.http.ProtocolVersion getProtocolVersion()
getProtocolVersion in interface org.apache.http.HttpMessagepublic org.apache.http.HeaderIterator headerIterator()
headerIterator in interface org.apache.http.HttpMessagepublic org.apache.http.HeaderIterator headerIterator(String arg0)
headerIterator in interface org.apache.http.HttpMessagepublic void removeHeader(org.apache.http.Header arg0)
removeHeader in interface org.apache.http.HttpMessagepublic void removeHeaders(String arg0)
removeHeaders in interface org.apache.http.HttpMessagepublic void setHeader(org.apache.http.Header arg0)
setHeader in interface org.apache.http.HttpMessagepublic void setHeader(String arg0, String arg1)
setHeader in interface org.apache.http.HttpMessagepublic void setHeaders(org.apache.http.Header[] arg0)
setHeaders in interface org.apache.http.HttpMessagepublic void setParams(org.apache.http.params.HttpParams arg0)
setParams in interface org.apache.http.HttpMessageCopyright © 2010–2014. All rights reserved.