T - the type of the content.public class HttpResponse<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
private T |
body |
private int |
code |
private Map<String,String> |
headers |
private InputStream |
rawBody |
| Constructor and Description |
|---|
HttpResponse(org.apache.http.HttpResponse response,
Class<T> responseClass)
Creates the response.
|
| Modifier and Type | Method and Description |
|---|---|
T |
body() |
String |
charset() |
int |
code() |
String |
contentType() |
org.apache.http.cookie.Cookie |
cookie(String name)
Retrieves a cookie.
|
private static byte[] |
getBytes(InputStream is) |
String |
header(String name)
Gets the value of the header.
|
Map<String,String> |
headers() |
private boolean |
isGzipped() |
int |
length() |
private void |
parseResponseBody(Class<T> responseClass,
org.apache.http.HttpEntity responseEntity) |
InputStream |
raw() |
private int code
private InputStream rawBody
private T body
private void parseResponseBody(Class<T> responseClass, org.apache.http.HttpEntity responseEntity)
private boolean isGzipped()
private static byte[] getBytes(InputStream is) throws IOException
IOExceptionpublic int code()
public InputStream raw()
public T body()
public String contentType()
public String charset()
public int length()
public String header(String name)
name - the header's namepublic org.apache.http.cookie.Cookie cookie(String name)
name - the name of the cookieCopyright © 2013–2014 Wisdom Framework. All rights reserved.