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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Format HTTP request body
Power Automate
Answered

Format HTTP request body

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I have an HTTP request where the body is raw text (the purpose is to create a file to upload via API)

In postman the request works fine but in flow the exact same calls fails. This seems to only be due to the formatting of the 'body' text as I've done the following test:

 

1) Run call in Postman successfully

2) Copy body from PM to Flow

3) Copy body back from Flow to PM

4) PM call fails (on the face of it the text is exactly the same, even checked with a code difference checker)

 

2019-03-31_1446.png

 

Anyone have any ideas how to correctly format in Flows? I've tried converting to string, using it in a variable etc but all with no success.

 

Thanks

Sam

 

 

 

Categories:
I have the same question (0)
  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    It seems flow does not know how to read the multipart text.

    I decided to create an additional test flow that receives HTTP requests so I can call it both from Postman and from my flow and see the difference.

     

    When receiving the request from Postman the body is converted to the following:

     

    {
     "$content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
     "$content": "LS0tLS0tV2ViS2l0Rm9ybUJvdW5kYXJ5N01BNFlXeGtUclp1MGdXDQpDb250ZW50LURpc3Bvc2l0aW9uOiBmb3JtLWRhdGE7IG5hbWU9ImZpbGUiOyBmaWxlbmFtZT0ibmV3LWFnZW50MTIzLnR4dCINCg0KdGVzdDEyMw0KDQotLS0tLS1XZWJLaXRGb3JtQm91bmRhcnk3TUE0WVd4a1RyWnUwZ1ctLQ==",
     "$multipart": [
     {
     "headers": {
     "Content-Disposition": "form-data; name=\"file\"; filename=\"new-agent123.txt\""
     },
     "body": {
     "$content-type": "application/octet-stream",
     "$content": "dGVzdDEyMw0K"
     }
     }
     ]
    }

    When sending the same call from Flow it is received as follows:

    {
     "$content-type": "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW",
     "$content": "LS0tLS0tV2ViS2l0Rm9ybUJvdW5kYXJ5N01BNFlXeGtUclp1MGdXCkNvbnRlbnQtRGlzcG9zaXRpb246IGZvcm0tZGF0YTsgbmFtZT0iZmlsZSI7IGZpbGVuYW1lPSJuZXctYWdlbnQxMjMudHh0IgoKdGVzdDEyMwoKLS0tLS0tV2ViS2l0Rm9ybUJvdW5kYXJ5N01BNFlXeGtUclp1MGdXLS0="
    }

    Flow just converts the whole body to base64 and doesn't break down the multipart values.

    Any ideas on how to do this via Flow?

     

    I've found the following realted post http://johnliu.net/blog/2017/7/building-non-json-webservices-with-flow but need some more help here on exactly how to go about doing this.

     

    Sam 

  • v-bacao-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous ,

     

    You could refer to the method mentioned in the blog.

    However, the trigger may need to use When a HTTP request is received, Request trigger has been changed.

    Please take a try.

     

    Best Regards,

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I've already had a look at that post but it's not clear to me exactly what I need to do.

    I have no experience working with swagger/OpenAPI, if you could provide me with some clear guidence on this that would be much appreciated.

     

    Thanks

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I found the solution here 

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 262 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 227

#3
Expiscornovus Profile Picture

Expiscornovus 225 Most Valuable Professional

Last 30 days Overall leaderboard