Batch

WebApiClient. Batch

new Batch(parameters)

Source:
See:

Batch to send using WebApiClient.SendBatch.
Batches can be used for sending multiple requests at once.
All requests inside a change set will be executed as a transaction, i.e. fail or succeed together.

Parameters:
Name Type Description
parameters Object
Properties
Name Type Attributes Description
name String <optional>

Name to set for this batch. Will be set to a default name if ommitted

changeSets Array.<ChangeSet> <optional>

Change Sets to include in this batch. Defaults to an empty array

requests Array.<Request> <optional>

GET requests to include in this batch. GET requests must be contained in here and are forbidden in change sets. Defaults to an empty array

headers Array.<{key:string, value:string}> <optional>

Headers to append to the batch.

async bool <optional>

True for sending async, false for sending sync. WebApiClient default is async

isOverLengthGet bool <optional>

Used internally for flagging a GET request that was originally not a batch but had to be transformed to a batch request automatically since the url was too long

Members

async

Source:
Properties:
Name Type Description
async bool

False for executing the batch synchronously, defaults to async

changeSets

Source:
Properties:
Name Type Description
changeSets Array.<ChangeSet>

Change sets included in this batch. Only non GET requests may be included here. Each change set will execute as a separate transaction

headers

Source:
Properties:
Name Type Description
headers Array.<{key:string, value:string}>

Headers for the batch

isOverLengthGet

Source:
Properties:
Name Type Description
isOverLengthGet bool

Used internally for flagging a GET request that was originally not a batch but had to be transformed to a batch request automatically since the url was too long

name

Source:
Properties:
Name Type Description
name String

Name of the batch

requests

Source:
Properties:
Name Type Description
requests Array.<Request>

GET Requests included in this batch. GET request may only be included in here

Methods

buildPayload() → {String}

Source:

Creates a text representation of the whole batch for sending as message body

This:
  • {Batch}
Returns:
Type
String