Package org.scribe.model
Class Response
- java.lang.Object
-
- org.scribe.model.Response
-
public class Response extends java.lang.Object
Represents an HTTP Response.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getBody()
Obtains the HTTP Response bodyint
getCode()
Obtains the HTTP status codejava.lang.String
getHeader(java.lang.String name)
Obtains a single HTTP Header value, or null if undefinedjava.util.Map<java.lang.String,java.lang.String>
getHeaders()
Obtains aMap
containing the HTTP Response Headersjava.lang.String
getMessage()
Obtains the HTTP status message.java.io.InputStream
getStream()
Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status codeboolean
isSuccessful()
-
-
-
Method Detail
-
isSuccessful
public boolean isSuccessful()
-
getBody
public java.lang.String getBody()
Obtains the HTTP Response body- Returns:
- response body
-
getStream
public java.io.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 java.lang.String getMessage()
Obtains the HTTP status message. Returnsnull
if the message can not be discerned from the response (not valid HTTP)- Returns:
- the status message
-
getHeaders
public java.util.Map<java.lang.String,java.lang.String> getHeaders()
Obtains aMap
containing the HTTP Response Headers- Returns:
- headers
-
getHeader
public java.lang.String getHeader(java.lang.String name)
Obtains a single HTTP Header value, or null if undefined- Parameters:
name
- the header name.- Returns:
- header value or null.
-
-