oauthP5.oauth
Class Response

java.lang.Object
  extended by oauthP5.oauth.Response

public class Response
extends Object

Represents an HTTP Response.

Author:
Pablo Fernandez

Method Summary
 String getBody()
          Obtains the HTTP Response body
 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
 InputStream getStream()
          Obtains the meaningful stream of the HttpUrlConnection, either inputStream or errorInputStream, depending on the status code
 boolean isSuccessful()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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

getHeaders

public Map<String,String> getHeaders()
Obtains a Map 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.


Processing library oauthP5 by New York Times R&D Lab. (c) 2012