Package org.scribe.model
Class Response
- java.lang.Object
-
- org.scribe.model.Response
-
public class Response extends Object
Represents an HTTP Response.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetBody()Obtains the HTTP Response bodyintgetCode()Obtains the HTTP status codeStringgetHeader(String name)Obtains a single HTTP Header value, or null if undefinedMap<String,String>getHeaders()Obtains aMapcontaining the HTTP Response HeadersStringgetMessage()Obtains the HTTP status message.InputStreamgetStream()Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status codebooleanisSuccessful()
-
-
-
Method Detail
-
isSuccessful
public boolean isSuccessful()
-
getBody
public String getBody()
Obtains the HTTP Response body- Returns:
- response body
-
getStream
public InputStream getStream()
Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status code- Returns:
- input stream / error stream
-
getCode
public int getCode()
Obtains the HTTP status code- Returns:
- the status code
-
getMessage
public String getMessage()
Obtains the HTTP status message. Returnsnullif the message can not be discerned from the response (not valid HTTP)- Returns:
- the status message
-
getHeaders
public Map<String,String> getHeaders()
Obtains aMapcontaining the HTTP Response Headers- Returns:
- headers
-
-