OpenSocial 1.0‎ > ‎

Core Data Spec

OpenSocial Pages supports the following OpenSocial Core Data Specification 1.0.

HTTP-Request-Params

Requests to arbitrary URLs use the following parameters:

Parameters

authz String Indicates the authorization method to use when sending data to the remote server. Must be one of "none", "signed", or "oauth". Defaults to "none".
format String Format data is returned in for processing, values are "json" or "text". Defaults to "json". Optional
headers Map<String, Array<String>> Additional HTTP headers to include in the request. Optional.
href String The URL to send the request to. Required.
oauth_service_name String Identifies the service element in the gadget spec to use for this request. Defaults to an empty string.
oauth_request_token String A token that is pre-approved by the provider for access to the resource. Optional.
oauth_request_token_secret String Secret associated with the pre-approved request token. Optional.
oauth_token_name String Identifies the OAuth token used to make a request to the service provider. Defaults to an empty string.
oauth_use_token String Controls whether an OAuth token should be used with the request. Allowed values are "always", "if_available", and "never". Optional.
refreshInterval number Number of seconds for which the container can cache the data. If this parameter is set, it overrides the HTTP response header sent back from the HTTP request. Optional.
sign_owner Boolean Indicates if the current viewer's ID should be included in the request signature. Defaults to "true".
sign_viewer Boolean Indicates if the current viewer's ID should be included in the request signature. Defaults to "true".
bodyString / Object
 

HTTP-Response-Payload

When a container makes an HTTP request on behalf of a gadget (e.g. osapi.http.get(), or <os:HttpRequest>) the response will contain the following properties:

content String / Object If @format is "text", the string content of the response. If @format is "json", the parsed JSON object or array of the response. If a JSON response cannot be parsed, a 406 (Not Acceptable) error code will be produced.
headers Map<String, Array<String>> An map with response header names as keys, and the header values as per-key arrays.
status number The HTTP status code.
Comments