Introduction¶
Batch requests allow grouping multiple individual requests into a single HTTP request payload.
An individual request in the context of a batch request is a Metadata Request, Data Request, Data Modification Request, Action invocation request, or Function invocation request.
Format of a Batch Request¶
- Request URL:
https://{host}:{port}/{main,b2b,int}/ifsapplications/projection/v1/{projection}.svc/$batch
- Request Method: POST
- Content-Type:
multipart/mixed;boundary=abc123
Important Parts in a Batch Payload¶
Individual requests and Change Sets are the main contents of a batch request. Change Set is a concept which allows you to bundle a couple of requests that need to be processed in a transactional way. Either all of the request parts in a change set are processed successfully or nothing is committed at all.
Note: You can't specify
GET
requests inside a Change Set.
Referencing Created Entity & ETag¶
You can use Dollar sign ($) with the Content-Id
header value to refer to previously created resource or ETag of the resource as depicted in the above image. In this example when you use $1 as the resource, it refers to the resource created by the request part which has 1 as the Content-Id header value. Also, the ETag value of that resource is referred when you specify $1 in the If-Match header.
Execution of a Batch Request¶
Request parts inside a batch request are processed sequentially as depicted in the following image.
Continuing on Errors¶
What if you want to continue execution even if a request part fails? You can specify this need in the Prefer header of the batch request as follows.
For more details about batch requests, click here.