public class Response extends Object
Constructor and Description |
---|
Response(int code,
String message,
Map<String,String> headers,
String body,
InputStream stream) |
Modifier and Type | Method and Description |
---|---|
String |
getBody()
Obtains the HTTP Response body
|
int |
getCode()
Obtains the HTTP status code
|
String |
getHeader(String name)
Obtains a single HTTP Header value, or null if undefined
|
Map<String,String> |
getHeaders()
Obtains a
Map containing the HTTP Response Headers |
String |
getMessage()
Obtains the HTTP status message.
|
protected InputStream |
getStream()
Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status code
|
boolean |
isSuccessful() |
String |
toString() |
public final boolean isSuccessful()
public String getBody()
protected InputStream getStream()
public final int getCode()
public String getMessage()
null
if the message can not be discerned from the response (not valid HTTP)public Map<String,String> getHeaders()
Map
containing the HTTP Response Headerspublic String getHeader(String name)
name
- the header name.Copyright © 2015. All rights reserved.