Skip to Content
Author's profile photo Pieterjan De Schrijver

The marriage between form-data and SAP Cloud Platform Integration

Dear community,

Did you ever faced the challenge of using a REST service with form-data instead of raw data?
This blog will describe how to deal with this requirement on your preferred cloud integration platform – SAP Cloud Platform Integration -.

The service

In my example, I’m using a service hosted on SAP Cloud Platform. This services is taking a CSV file as request form-data. Once the data is accepted by the service, the records are stored into a custom table. In order to upload your file, the service is handling the form-data (multipart).
Additional documentation about this content-type can be found here:

Sample csv file


Testing the service stand alone

It is always a good practice to test your service stand alone before actually implementing it in your middleware system.

Endpoint: SAP SCP Service

Cloud Platform Integration setup

One on one pass through

The idea of this scenario is to get a pass through integration. The payload sent towards CPI will be exactly the same as the one sent to SAP Cloud Platform (“The Service”).

Some important remarks about this flow:

  • Allowed Headers
  • Sender connection
  • Receiver connection

Testing via postman:

Endpoint: SAP Cloud Platform Integration endpoint

Sender is multipart upload

The idea of this interface is to be able to send form-data towards CPI, and afterwards handle the data from the attachment (for example convert csv to xml) in your flow. The purpose of this interface is to return the data from the attachment as response to our call.

Some important remarks about this flow:

  • Allowed Headers
  • Sender connection
  • Mime Multipart Decoder

Testing via postman:

Endpoint: SAP Cloud Platform Integration endpoint

Receiver is multipart upload

In this iflow I will set my csv content via a content Modifier, create my body and send the payload as form-data towards “the service” on SAP Cloud Platform.

Some important remarks about this flow:

  • Content Modifier 1 : “SetContent”
  • Content Modifier 2 : “CreateFormData”
    Used to build the multipart

  • Receiver connection

As this is a timer based interface, I can’t test it via Postman. However when the interface is running and you place your traces, you’ll be able to see the response as well.

I hope this will help you handling multipart/form-data integrations in the future.

And they lived happily ever after…

Kind regards,
Pieterjan De Schrijver
Cloud integration consultant @ delaware


Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Gayathri Narayana
      Gayathri Narayana

      Interesting use-case, thanks for Blogging!


      Author's profile photo Former Member
      Former Member

      Hi Pieterjan,


      Really a fantastic blog. Have you ever try to setup an integration flow with a http sender adapter and a mail receiver adapter for the scenario send an email with multipart/form attachment?

      I have met trouble that parsing the multipart/form files and set it into the messagebody attachments.

      Do you have any experience on that?


      Thanks and Best Regards



      Author's profile photo Braiden Psiuk
      Braiden Psiuk

      Hi Pieterjan,

      I have a very similar use case, the only difference is that I am sending raw JPEG image data instead of a CSV file. I have followed along using your "Receiver is multipart upload" step in this blog, but I have not had any luck properly making the request.

      I posted a question about this on which goes into much more detail about my problem. I would really appreciate it if you check out my post here.

      The Content-Modifier (that you called "CreateFormData" in your iflow) corrupts my image data and prevents me from properly making my request, likely because it encodes the binary image data as a string. Do you know of a way to format this multipart request properly without corrupting the data?

      Thank you for your awesome blog post.



      Author's profile photo Amita B
      Amita B

      Hi Pieterjan,

      I followed the same steps as mentioned in your blog. But I get below error:

      HTTP operation failed invoking (vendor URL) with statusCode: 500


      I tried with both the below content in body of content modifier

      Content-Disposition: form-data; name="file"; filename="employment.csv"
      Content-Type: text/csv





      Content-Disposition: form-data; name="file"; filename="employment.csv"
      Content-Type: application/


      Please let me know what could be wrong.

      Author's profile photo Claudio Palladino
      Claudio Palladino

      Hi Amita,


      did u found the solution?
      i am facing the same problem...



      Author's profile photo Srikrishna Sirsalle
      Srikrishna Sirsalle

      Hi Amita, Claudio,


      Did you find the solution for http 500 error?

      I am also getting the same error despite following all mentioned steps.



      Author's profile photo Vignesh T
      Vignesh T

      Hi Amita,


      Im facing same problem when invoking HTTP API with internal server error 500.

      Did u find the solution?