Create a multipart fom data to send multiple fields

HI,

we are struggling with creating a multiple-fileds multipart formdata to send to some APIs.

After a lot of frustration with natve policies, we landed on Dino's

Apigee-Java-Simple-MultipartForm

but it seems it can manage a multipart form creator which permit to send just one file, is it true?
Is it possible with it to send multiple files/fields in the same multipart request?

Thanks in adance

Bests

0 6 1,000
6 REPLIES 6

Sure, it's possible, but not with that existing callout. You'd need to modify that "SimpleForm" callout to suit your needs.

EDIT 2021 March 16 I've updated that callout so that it can now produce a multipart form using multiple parts.

Sorry surely I'm missing something, but what's that "SimpleForm" callout you're saying? Where can I find it?

Last but not least, what do you mean by "modify"?

Thanks

Sorry about going dark. I've modified that callout so that it can handle multiple parts now. Check the updated readme.

Not applicable

Hi @DChiesa 

I need to pass through .csv file or xml file from APIGEE X to backend, above mentioned git repo  will work ? how i can pass through .csv file data from APIGEE to backend.

 

Hi 

I think you have asked a completely new question in a comment on an old thread. 

Apigee acts as a pass-through.  If you send it a CSV file, it will pass it through to the backend.  If you send Apigee an XML file, it will pass it through to the backend.  You have the option to configure Apigee to do something different with the payloads - for example transform XML to JSON, or transform CSV to JSON.... but you have to take explicit steps to make that happen.  By default Apigee simply passes through the payload. 

This also means that if your client system sends in a multi-part form payload into Apigee, Apigee will pass it through to the backend, unless you configure Apigee to do something different. In some cases, People want to configure Apigee to extract one of the items from a multipart form, and pass only that item through to the backend.  For example, extract the CSV from the multipart form, and send only the CSV to the backend.  You can do that with Apigee too.  The Multipart form parser Java callout will help with that. 

If you have some other specific question, please post a new question using the "Ask a Question" button in the upper-right corner of your web browser.

thanks.