Package com.github.scribejava.core.model
Class Response
- java.lang.Object
- 
- com.github.scribejava.core.model.Response
 
- 
- All Implemented Interfaces:
- Closeable,- AutoCloseable
 
 public class Response extends Object implements Closeable 
- 
- 
Method SummaryModifier and Type Method Description voidclose()StringgetBody()Returns the response body as a string, closing the stream that backs it.intgetCode()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()StringtoString()
 
- 
- 
- 
Method Detail- 
isSuccessfulpublic boolean isSuccessful() 
 - 
getBodypublic String getBody() throws IOException Returns the response body as a string, closing the stream that backs it. Idempotent.- Returns:
- body as string
- Throws:
- IOException- IO Exception
 
 - 
getStreampublic InputStream getStream() Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status code- Returns:
- input stream / error stream
 
 - 
getCodepublic int getCode() Obtains the HTTP status code- Returns:
- the status code
 
 - 
getMessagepublic String getMessage() Obtains the HTTP status message. Returnsnullif the message can not be discerned from the response (not valid HTTP)- Returns:
- the status message
 
 - 
getHeaderspublic Map<String,String> getHeaders() Obtains aMapcontaining the HTTP Response Headers- Returns:
- headers
 
 - 
getHeaderpublic String getHeader(String name) Obtains a single HTTP Header value, or null if undefined- Parameters:
- name- the header name.
- Returns:
- header value or null.
 
 - 
closepublic void close() throws IOException- Specified by:
- closein interface- AutoCloseable
- Specified by:
- closein interface- Closeable
- Throws:
- IOException
 
 
- 
 
-