public class Response extends Object
| Constructor and Description |
|---|
Response(int code,
String message,
Map<String,String> headers,
InputStream stream) |
Response(int code,
String message,
Map<String,String> headers,
String body) |
| Modifier and Type | Method and Description |
|---|---|
String |
getBody() |
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.
|
InputStream |
getStream()
Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the
status code
|
boolean |
isSuccessful() |
String |
toString() |
public Response(int code,
String message,
Map<String,String> headers,
InputStream stream)
public boolean isSuccessful()
public String getBody() throws IOException
IOExceptionpublic InputStream getStream()
public 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 © 2018. All rights reserved.