public class HttpResponseImpl extends Object implements HttpResponse
| 限定符和类型 | 方法和说明 |
|---|---|
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 在接口中 HttpResponseT - the generic typereturnType - the return typepublic <T> T getEntity(Class<T> returnType, ExecutionOptions<T> options)
getEntity 在接口中 HttpResponseT - the generic typereturnType - the return typeoptions - execution optionspublic int getStatus()
getStatus 在接口中 HttpResponsepublic String getStatusMessage()
getStatusMessage 在接口中 HttpResponsepublic InputStream getInputStream()
getInputStream 在接口中 HttpResponsepublic String header(String name)
header 在接口中 HttpResponsename - the name of the header to query forpublic Map<String,String> headers()
headers 在接口中 HttpResponsepublic <T> T readEntity(Class<T> typeToReadAs)
readEntity 在接口中 HttpResponsepublic void close()
throws IOException
close 在接口中 Closeableclose 在接口中 AutoCloseableIOExceptionpublic String getContentType()
getContentType 在接口中 HttpResponseCopyright © 2020. All rights reserved.