cancel
Showing results for 
Search instead for 
Did you mean: 

Grouping many individual REST requests into a single REST $batch POST

MattB
New Contributor II

Does anyone have any experience of batching many individual REST requests within a single odata $batch REST POST avoiding the set up costs associated with making a large number of individual requests.

I can do so within Snaplogic by grouping and then transforming multiple REST requests into a large string containing the batched requests to be sent within a single REST POST, but wanted to check I haven’t missed something obvious with either the REST POST or HTTP Client Snaps that can be used to do so automatically.

Example REST POST, containing a batch of two GET requests - my use case is several thousand POST, PATCH or DELETEs.

POST https://fabrikam.sharepoint.com/_api/$batch HTTP/1.1
Authorization: Bearer <access token omitted>
Content-Type: multipart/mixed; boundary=batch_e3b6819b-13c3-43bb-85b2-24b14122fed1
Host: fabrikam.sharepoint.com
Content-Length: 527
Expect: 100-continue

--batch_e3b6819b-13c3-43bb-85b2-24b14122fed1
Content-Type: application/http
Content-Transfer-Encoding: binary

GET https://fabrikam.sharepoint.com/_api/Web/lists/getbytitle('Composed%20Looks')/items?$select=Title HTTP/1.1

--batch_e3b6819b-13c3-43bb-85b2-24b14122fed1
Content-Type: application/http
Content-Transfer-Encoding: binary

GET https://fabrikam.sharepoint.com/_api/Web/lists/getbytitle('User%20Information%20List')/items?$select=Title HTTP/1.1

--batch_e3b6819b-13c3-43bb-85b2-24b14122fed1--

Any thoughts or similar problems solved within the community?

Thanks,
Matt.

0 REPLIES 0