function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
logontokartiklogontokartik 

Sending a Batch Request over a HTTPREQUEST (Callout)??

Hello All,

 

I am kind of a stuck here. I am doing integration with an external System which have their REST Services defined. So in order to GET,POST to their services I am using the single EndPoint URL, building Http BODY through DOM classes and posting data.

 

But if I want to send multiple POSTS at a time, I need to send a Batch Http POST (content-type : multipart/mixed) to the external Service. I am not sure how to do it via APEX. 

 

If anyone out there did it, any direction is helpful. Appreciate it.

 

Thanks.

Kartik.

dkadordkador

Multipart is just a specially formatted body, so what you'll have to do is build up the body yourself in apex (including the various parts), then set the content-type of the request to multipart/mixed, and send it over.

 

We do not have any built-in support to Apex to make sending multipart requests easy.