public class HttpClientResponse extends Object
| Modifier and Type | Field and Description |
|---|---|
protected static boolean |
DO_NOT_STORE_RESPONSE_BODY |
protected static boolean |
STORE_RESPONSE_BODY |
| Modifier | Constructor and Description |
|---|---|
protected |
HttpClientResponse(HttpURLConnection connection) |
| Modifier and Type | Method and Description |
|---|---|
byte[] |
getBodyContent()
Returns the content of the response body
|
String |
getContentEncoding()
Returns the value of the "content-encoding" header field.
|
int |
getContentLength()
Returns the value of the "content-length" header field.
|
String |
getContentType()
Returns the value of the "content-type" header field.
|
Collection<String> |
getHeader(String name)
Returns an unmodifiable List of Strings that represents the corresponding header field values.
|
Map<String,List<String>> |
getHeaderMap()
Returns all the header fields ( including the http status ) stored in an unmodifiable Map
The Map keys are Strings that represent the response-header field names. |
int |
getStatusCode()
Returns the status code from an HTTP response message : 200 ( OK ), 404 ( Not Found ), etc
|
String |
getStatusMessage()
Returns the HTTP response message if any : "OK", "Not Found", "Unauthorized", etc
|
protected static final boolean STORE_RESPONSE_BODY
protected static final boolean DO_NOT_STORE_RESPONSE_BODY
protected HttpClientResponse(HttpURLConnection connection) throws Exception
Exceptionpublic int getStatusCode()
public String getStatusMessage()
public int getContentLength()
public String getContentType()
public String getContentEncoding()
public byte[] getBodyContent()
public Collection<String> getHeader(String name)
name - the header field name ( "Server", "Content-Type", ... )public Map<String,List<String>> getHeaderMap()
Copyright © 2016. All rights reserved.