| Constructor and Description |
|---|
HttpClientResponse(org.apache.http.client.methods.CloseableHttpResponse response) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
getEntity(Class<T> entityClass)
Unmarshall the response body as the specified type
|
String |
getHeader(String name)
Get's the header by the given name
|
Map<String,String> |
getHeaders()
Get a map of all the headers
|
InputStream |
getResponseBodyAsStream() |
String |
getResponseBodyAsString() |
int |
getStatusCode() |
String |
getStatusText() |
boolean |
isSuccessful() |
public HttpClientResponse(org.apache.http.client.methods.CloseableHttpResponse response)
throws IOException
IOExceptionpublic int getStatusCode()
getStatusCode in interface Responsepublic String getStatusText()
getStatusText in interface Responsepublic boolean isSuccessful()
isSuccessful in interface Responsepublic String getHeader(String name)
ResponsegetHeader in interface Responsename - The name of the headernull is returned.public Map<String,String> getHeaders()
ResponsegetHeaders in interface Responsepublic String getResponseBodyAsString() throws ResponseException
getResponseBodyAsString in interface ResponseResponseException - If the response cannot be retrievedpublic InputStream getResponseBodyAsStream() throws ResponseException
getResponseBodyAsStream in interface ResponseResponseException - If the response cannot be retrievedpublic <T> T getEntity(Class<T> entityClass) throws ResponseException
ResponsegetEntity in interface ResponseentityClass - the type of the responseResponseException - if there was difficulty reading the response or unmarshalling the objectCopyright © 2019 Atlassian. All rights reserved.