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)
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
Solved! Go to Solution.
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
Hi @SamPo ,
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,
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
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Announcing a new way to share your feedback with the Power Automate Team.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
43 | |
18 | |
15 | |
14 | |
13 |
User | Count |
---|---|
68 | |
37 | |
29 | |
21 | |
19 |