Multipart/form-data

Multipart/form-data (ODC)

Stable version 0.1.1 (Compatible with ODC)
Uploaded on 07 August 2024 by OutSystems Labs
Multipart/form-data

Multipart/form-data (ODC)

Documentation
0.1.1

To create a Multipart/form-data request you can use the "PartAdd" action to create a new "Part" in the request.
If you need to use more than one part, you can use the output of the previous part as the input value "Parts" for the next part:


Once all parts are added, you need to use the "MultipartFormDataCreate" action by passing the output value of the last part added.

You can let the action generate a Boundary value automatically, or pass your own. When passing your own, make sure that the Boundary value will not appear inside the content of your parts.


You can now use the output of the "MultipartFormDataCreate" on your API call.
The API you consume must only have a single input parameter of type "Binary Data" sent in the Body. You use the "MessageBinary" output value of "MultipartFormDataCreate" action there,

You will also need to pass in a Content-Type header. You use the "ContentType" output of the "MultipartFormDataCreate" action there.




To expose an API that receives Multipart/form-data, you need to expose an endpoint with a single input of Type "Binary Data"



You will need to use the "Parse_Boundary" action to retrieve the Multipart/form-data boundary sent in the Content-Type header.


Once you have the boundary, you can pass it alongside the "Binary Data" input value.

If the parsing was successful, you will get a list of Parts that you can iterate and perform your own logic with them.