Sending file as multipart/formdata

Hi

I have an integration that requires a file to be sent to an endpoint as multipart/formdata. 

Is this possible using Application Integration? I've had a play with the 'Call REST endpoint' task but can't see how to do it.

Thanks

Solved Solved
0 3 669
1 ACCEPTED SOLUTION

Hi @dan_j_r,

Welcome to Google Cloud Community!

Yes, it's definitely possible to send files as multipart/formdata using Google Cloud's Application Integration. You can achieve this using the "Call REST endpoint" task. Here's how:

Configure the "Call REST endpoint" task:

  • URL: Specify the URL of the endpoint that accepts the file upload.
  • Method: Set the method to POST.
  • Headers: Add the following headers:
    • Content-Type: multipart/form-data; boundary=<boundary> (Replace <boundary> with a unique string that separates different parts of the multipart data).
  • Body: Choose the "File" option and select the file you want to upload.
  • Additional options:
    • Enable streaming for larger files to improve performance.
    • Use authentication headers if required by the endpoint.

 Documentation:

View solution in original post

3 REPLIES 3

Hi @dan_j_r,

Welcome to Google Cloud Community!

Yes, it's definitely possible to send files as multipart/formdata using Google Cloud's Application Integration. You can achieve this using the "Call REST endpoint" task. Here's how:

Configure the "Call REST endpoint" task:

  • URL: Specify the URL of the endpoint that accepts the file upload.
  • Method: Set the method to POST.
  • Headers: Add the following headers:
    • Content-Type: multipart/form-data; boundary=<boundary> (Replace <boundary> with a unique string that separates different parts of the multipart data).
  • Body: Choose the "File" option and select the file you want to upload.
  • Additional options:
    • Enable streaming for larger files to improve performance.
    • Use authentication headers if required by the endpoint.

 Documentation:

Hello,

Sorry for opening this solved thread.

Has the configuration pannel changed ?
I am trying to do the same call (send a file multipart/form-data) but i do not see how it's possible to choose File option for body. I see only String or Variable.

 

Torapa_1-1718266365519.png

thank you in advance.

I am seeing the same issue.  No matter what you variable type you select in request body, it always changes to STR.
Here is my related ticket:
https://www.googlecloudcommunity.com/gc/Integration-Services/REST-Endpoint-Task-not-able-pass-JSON-a...