Osapi.BatchRequest (v0.9)

From VZ Developer Wiki
Revision as of 12:22, 29 July 2010 by Seba (talk | contribs) (Created page with '{{NeedsExamples}} <div style="float:right; margin: 0 0 10px 10px;">__TOC__</div> <span style="font-size:150%"><strong>Batch Request Objects</strong></span> Service requests can…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This documentation is not completed yet and will be extended by more examples in future.

Batch Request Objects

Service requests can be combined into a single batch request using the following methods:

Methods

osapi.newBatch

<static> osapi.BatchRequest osapi.newBatch()
Returns
Type Description
osapi.BatchRequest A new batch request.
Description
Creates a new batch request.

osapi.BatchRequest.add

<static> osapi.BatchRequest osapi.add(key, request)
Parameters
Name Type Description
key String A key to access the result of the given request from the parameter sent to the callback function.
request osapi.Request A request to add to the batch.
Returns
Type Description
osapi.BatchRequest A batch request containing the given request (and any previously added requests).
Description
Adds a service request to the batch associated with the specified key. A single batch request can contain both JSON-RPC calls (e.g. osapi.people.get()) and HTTP calls to third parties (e.g. osapi.http.get()).

osapi.BatchRequest.execute

<static> osapi.Request.execute(callback)
Parameters
Name Type Description
callback Function A callback function to handle the response.
Description
Executes all of the requests in the batch. Takes a callback for response processing, which is passed a JSON object mapping each request key to a JSON response object.



OpenSocial (v0.9)

gadgets

gadgets.io

gadgets.json

gadgets.Prefs

gadgets.util

gadgets.views

gadgets.flash

gadgets.MiniMessage

gadgets.oauth.Popup

gadgets.rpc

gadgets.skins

gadgets.pubsub

gadgets.Tab

gadgets.TabSet

gadgets.window

gadgets.i18n

opensocial

opensocial.Activity

opensocial.Address

opensocial.Album

opensocial.BodyType

opensocial.Collection

opensocial.CreateActivityPriority

opensocial.DataRequest

opensocial.DataResponse

opensocial.Email

opensocial.Enum

opensocial.Environment

opensocial.EscapeType

opensocial.IdSpec

opensocial.MediaItem

opensocial.Message

opensocial.MessageCollection

opensocial.Name

opensocial.NavigationParameters

opensocial.Organization

opensocial.Permission

opensocial.Person

opensocial.Phone

opensocial.ResponseItem

opensocial.Url

osapi.Request

osapi.BatchRequest

osapi.people

osapi.activities

osapi.appdata

osapi.messages

osapi.http