Class HttpBatch

Represents an HTTP Batch operation. Individual HTTP requests are added with the add method and the batch is executed using execute.

Index

Methods

Methods

public add(httpRequest: HttpRequest, opt_params?: { id: string; callback: (individualResponse: any, rawBatchResponse: any) => any; })

Adds a gapi.client.HttpRequest to the batch.

Parameters

  • httpRequest: HttpRequest

    The HTTP request to add to this batch.

  • opt_params?: { id: string; callback: (individualResponse: any, rawBatchResponse: any) => any; } optional

    extra parameters for this batch entry.

public execute(callback: (responseMap: any, rawBatchResponse: string) => any)

Executes all requests in the batch. The supplied callback is executed on success or failure.

Parameters

  • callback: (responseMap: any, rawBatchResponse: string) => any

    The callback to execute when the batch returns.