Package com.github.scribejava.core.model
Class Response
- java.lang.Object
-
- com.github.scribejava.core.model.Response
-
public class Response extends Object
-
-
Method Summary
Modifier and Type Method Description String
getBody()
int
getCode()
Obtains the HTTP status codeString
getHeader(String name)
Obtains a single HTTP Header value, or null if undefinedMap<String,String>
getHeaders()
Obtains aMap
containing the HTTP Response HeadersString
getMessage()
Obtains the HTTP status message.InputStream
getStream()
Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status codeboolean
isSuccessful()
String
toString()
-
-
-
Method Detail
-
isSuccessful
public boolean isSuccessful()
-
getBody
public String getBody() throws IOException
- Throws:
IOException
-
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. Returnsnull
if the message can not be discerned from the response (not valid HTTP)- Returns:
- the status message
-
getHeaders
public Map<String,String> getHeaders()
Obtains aMap
containing the HTTP Response Headers- Returns:
- headers
-
getHeader
public String getHeader(String name)
Obtains a single HTTP Header value, or null if undefined- Parameters:
name
- the header name.- Returns:
- header value or null.
-
-