+ 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.