public class HttpResponseImpl extends Object implements HttpResponse
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
getContentType() |
<T> T |
getEntity(Class<T> returnType)
Gets the entity and Maps any errors which will result in a ResponseException
|
<T> T |
getEntity(Class<T> returnType,
ExecutionOptions<T> options)
Gets the entity and Maps any errors which will result in a ResponseException
|
InputStream |
getInputStream() |
int |
getStatus()
Gets the status from the previous Request
|
String |
getStatusMessage() |
String |
header(String name)
Returns a Header value from the specified name key
|
Map<String,String> |
headers() |
<T> T |
readEntity(Class<T> typeToReadAs) |
org.apache.http.client.methods.CloseableHttpResponse |
unwrap()
Unwrap and return the original Response
|
static HttpResponseImpl |
wrap(org.apache.http.client.methods.CloseableHttpResponse response)
Wrap the given Response
|
public static HttpResponseImpl wrap(org.apache.http.client.methods.CloseableHttpResponse response)
response - the responsepublic org.apache.http.client.methods.CloseableHttpResponse unwrap()
public <T> T getEntity(Class<T> returnType)
getEntity in interface HttpResponseT - the generic typereturnType - the return typepublic <T> T getEntity(Class<T> returnType, ExecutionOptions<T> options)
getEntity in interface HttpResponseT - the generic typereturnType - the return typeoptions - execution optionspublic int getStatus()
getStatus in interface HttpResponsepublic String getStatusMessage()
getStatusMessage in interface HttpResponsepublic InputStream getInputStream()
getInputStream in interface HttpResponsepublic String header(String name)
header in interface HttpResponsename - the name of the header to query forpublic Map<String,String> headers()
headers in interface HttpResponsepublic <T> T readEntity(Class<T> typeToReadAs)
readEntity in interface HttpResponsepublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOExceptionpublic String getContentType()
getContentType in interface HttpResponseCopyright © 2019. All rights reserved.