Osapi.BatchRequest (v0.9)

Osapi.BatchRequest (v0.9)

NeedsExamples

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
TypeDescription |

Description
Creates a new batch request.

osapi.BatchRequest.add

;<static> osapi.BatchRequest osapi.add(key, request)

Parameters
NameTypeDescription |

Returns
TypeDescription |

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
NameTypeDescription |

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.

{{ JsApiAlphaList_(v0.9) }}