Response
This class is no longer available in the most recent version of the SDK.
A more recent version of this class is available. Check out the latest version.

Encapsulates the response, successful or otherwise, of a call to the Facebook platform.

Extends:Object
Package:facebook
Instance Methods
getError()

Returns information about any errors that may have occurred during the request.

public final FacebookRequestError getError()
Returns
The error from the server, or null if there was no server error
getGraphObject()

The single graph object returned for this request, if any.

public final GraphObject getGraphObject()
Returns
The graph object returned, or null if none was returned (or if the result was a list)
getGraphObjectAs(Class)

The single graph object returned for this request, if any, cast into a particular type of GraphObject.

public final GraphObject getGraphObjectAs(Class graphObjectClass)
ParameterDescription
graphObjectClassThe GraphObject-derived interface to cast the graph object into
Returns
The graph object returned, or null if none was returned (or if the result was a list)
getGraphObjectList()

The list of graph objects returned for this request, if any.

public final GraphObjectList getGraphObjectList()
Returns
The list of graph objects returned, or null if none was returned (or if the result was not a list)
getGraphObjectListAs(Class)

The list of graph objects returned for this request, if any, cast into a particular type of GraphObject.

public final GraphObjectList getGraphObjectListAs(Class graphObjectClass)
ParameterDescription
graphObjectClassThe GraphObject-derived interface to cast the graph objects into
Returns
The list of graph objects returned, or null if none was returned (or if the result was not a list)
getConnection()

Returns the HttpURLConnection that this response was generated from. If the response was retrieved from the cache, this will be null.

public final HttpURLConnection getConnection()
Returns
The connection, or null
getRequest()

Returns the request that this response is for.

public Request getRequest()
Returns
The request that this response is for
getRawResponse()

Returns the server response as a String that this response is for.

public String getRawResponse()
Returns
A String representation of the actual response from the server
getRequestForPagedResults(PagingDirection)

If a Response contains results that contain paging information, returns a new Request that will retrieve the next page of results, in whichever direction is desired. If no paging information is available, returns null.

public Request getRequestForPagedResults(PagingDirection direction)
ParameterDescription
directionEnum indicating whether to page forward or backward
Returns
A Request that will retrieve the next page of results in the desired direction, or null if no paging information is available
getIsFromCache()

Indicates whether the response was retrieved from a local cache or from the server.

public final boolean getIsFromCache()
Returns
True if the response was cached locally, false if it was retrieved from the server
Constants
NON_JSON_RESPONSE_PROPERTY
Property name of non-JSON results in the GraphObject. Certain calls to Facebook result in a non-JSON response (e.g., the string literal "true" or "false"). To present a consistent way of accessing results, these are represented as a GraphObject with a single string property with this name.
public static final String NON_JSON_RESPONSE_PROPERTY