web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id : qPgyXgIIfPSCYI29vFF6VM
Power Automate - Using Connectors
Answered

Send multi-part form data with flow HTTP task

Like (1) ShareShare
ReportReport
Posted on 22 Nov 2019 19:58:18 by 38

Hi,

 

I have to repost this question as this forum had an issue with my original post.

I'm struggling with multi-part form data. I need to send a binary file to REST API with plain HTTP and no json data.

How is this possible with the flow HTTP task?

 

It's also not possible to upload an image here.

Please see screenshot in link: Flow Task 

 

 

I have the same question (0)
  • Verified answer
    SvenG Profile Picture
    38 on 25 Nov 2019 at 13:25:46
    Re: Send multi-part form data with flow HTTP task

    While searching through similar post here I came to some conclusions. 

    What I've found out so far is that one can use a special json syntax for the HTTP body.

     

     

    I got it working now:

     

     

    {
     "$content-type": "multipart/form-data",
     "$multipart": [
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"file\"; filename=\"test.pdf\""
     },
     "body": {
     "$Content-type": "@{items('Auf_alle_anwenden')?['ContentType']}",
     "$content": @{items('Auf_alle_anwenden')?['ContentBytes']}
     }
     },
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"type\""
     },
     "body": "voucher"
     }
     ]
    }

     

     

    There was an issue that the API accepts only binary data.  I could resolve it by removing the base64 encoding found in a similar thread.

     

    It's really bad that there is no documentation about the HTTP task at all. 

  • SvenG Profile Picture
    38 on 25 Nov 2019 at 06:56:35
    Re: Send multi-part form data with flow HTTP task

    Hi @v-bacao-msft 

     

    I'm using this API and try to upload a file. They have working example of curl and postman.

     

    Thanks for your support

    Sven

     

     

    Edit, the question now is:

    What's the correct flow task setup for the following curl command:

    curl https://api.lexoffice.io/v1/files
    -X POST
    -H "Authorization: Bearer {accessToken}"
    -H "Content-Type: multipart/form-data"
    -H "Accept: application/json"
    -F "file=@{PathToImage}" -F "type=voucher"

     

  • v-bacao-msft Profile Picture
    on 25 Nov 2019 at 02:09:15
    Re: Send multi-part form data with flow HTTP task

     

    Hi @SvenG ,

     

    Which API do you currently use, and are there any documents for reference?

     

    Best Regards,

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

MS.Ragavendar – Community Spotlight

We are honored to recognize Ragavendar Swaminatha Subramanian as our September…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 736 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 396 Moderator

#3
Power Apps 1919 Profile Picture

Power Apps 1919 339

Last 30 days Overall leaderboard

Featured topics

Loading started
Loading complete