public class ApacheHttpResponse extends Object implements IHttpResponse
HttpResponse| Constructor and Description |
|---|
ApacheHttpResponse(org.apache.http.HttpResponse theResponse) |
| Modifier and Type | Method and Description |
|---|---|
void |
bufferEntitity()
Deprecated.
|
void |
bufferEntity()
Buffer the message entity data.
|
void |
close()
Close the response
|
Reader |
createReader()
Returna reader for the response entity
|
Map<String,List<String>> |
getAllHeaders()
Get map of the response headers and corresponding string values.
|
List<String> |
getHeaders(String theName)
Return all headers in the response with the given type
|
String |
getMimeType()
Extracts
Content-Type value from the response exactly as
specified by the Content-Type header. |
org.apache.http.HttpResponse |
getResponse() |
int |
getStatus()
Get the status code associated with the response.
|
String |
getStatusInfo()
Get the response status information reason phrase associated with the response.
|
InputStream |
readEntity()
Read the message entity input stream as an InputStream.
|
public ApacheHttpResponse(org.apache.http.HttpResponse theResponse)
@Deprecated public void bufferEntitity() throws IOException
bufferEntitity in interface IHttpResponseIOExceptionpublic void bufferEntity() throws IOException
IHttpResponseIn case the message entity is backed by an unconsumed entity input stream, all the bytes of the original entity input stream are read and stored in a local buffer. The original entity input stream is consumed.
In case the response entity instance is not backed by an unconsumed input stream
an invocation of bufferEntity method is ignored and the method returns.
This operation is idempotent, i.e. it can be invoked multiple times with
the same effect which also means that calling the bufferEntity()
method on an already buffered (and thus closed) message instance is legal
and has no further effect.
Buffering the message entity data allows for multiple invocations of
readEntity(...) methods on the response instance.
bufferEntity in interface IHttpResponseIOExceptionpublic void close()
IHttpResponseclose in interface IHttpResponsepublic Reader createReader() throws IOException
IHttpResponsecreateReader in interface IHttpResponseIOExceptionpublic Map<String,List<String>> getAllHeaders()
IHttpResponsegetAllHeaders in interface IHttpResponsepublic List<String> getHeaders(String theName)
IHttpResponsegetHeaders in interface IHttpResponsepublic String getMimeType()
IHttpResponseContent-Type value from the response exactly as
specified by the Content-Type header. Returns null
if not specified.getMimeType in interface IHttpResponsepublic org.apache.http.HttpResponse getResponse()
getResponse in interface IHttpResponsepublic int getStatus()
IHttpResponsegetStatus in interface IHttpResponsepublic String getStatusInfo()
IHttpResponsegetStatusInfo in interface IHttpResponsepublic InputStream readEntity() throws IOException
IHttpResponsereadEntity in interface IHttpResponseIOExceptionCopyright © 2014–2017 University Health Network. All rights reserved.