HTTP Post call blank file

Craig Darnley 20 Reputation points
2023-09-05T13:18:28.5+00:00

I have a Logic app that sends a One Drive file to external API,

File makes it to endpoint and shows in UI , however if I download that file it is blank

Send the same file in Postman and works correctly

Any help gratefully received :)

User's image

Azure Logic Apps
Azure Logic Apps
An Azure service that automates the access and use of data across clouds without writing code.
3,542 questions
{count} votes

Accepted answer
  1. MayankBargali-MSFT 70,936 Reputation points Moderator
    2023-09-06T13:16:59.96+00:00

    @Craig Darnley Thanks for reaching out. It is more about what is the right way your endpoint accepts the body and header. Have you tried to create the request using fiddler or postman to test it to confirm if the file is created correctly? Once you have validated with fiddler/postman then it would be easy to troubleshoot it from the HTTP action end whether the request is formed correctly or not.

    Please share the request details from the postman/fiddler end. There are some limitations from HTTP connector end as documented here with the Omitted HTTP headers but as per your request I don't see any.

    Further you try to use the JSON object in the body as documented here and see if it resolves the issue.

    To handle content that has multipart/form-data type in HTTP requests, you can add a JSON object that includes the $content-type and $multipart attributes to the HTTP request's body by using this format.

    "body": {
       "$content-type": "multipart/form-data",
       "$multipart": [
          {
             "body": "<output-from-trigger-or-previous-action>",
             "headers": {
                "Content-Disposition": "form-data; name=file; filename=<file-name>"
             }
          }
       ]
    }
    
    
    

    img

    1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.