Send binary data through HTTP in Power Automate

Send binary data in HTTP requests | Power Automate

Table of Contents

Working with binary data in HTTP requests is a common requirement when integrating Power Automate with external systems and APIs, but handling binary content correctly requires an specific format in Power Automate to obtain successful responses from the API service.

This is how a regular binary content request looks in Postman:

Turn your ideas into digital solutions

Our team guides you step by step to build custom apps in Power Platform.

In this guide, we’ll explain how to convert above and how to send binary data in Power Automate through the HTTP request action and how to combine it with SharePoint’s get file content.

Step 1. Get File content from SharePoint

First, let’s get the content of the file we want to upload to the external system. For that, we will use the “Get file content” action from SharePoint.

For this example we’re directly selecting the PDF file from the file selector in Power Automate, but this can totally be dynamic content from another step if needed.

Step 2. Create HTTP request with binary data

The body for the HTTP request when sending binary data is as follows:

				
					{
  "$content-type": "multipart/form-data",
  "$multipart": [
    {
      "body": {file content from previous step},
      "headers": {
        "Content-Disposition": "form-data; name=\"file\"; filename=\"{filename with extension}\";"
      }
    }
  ]
}

				
			

Result in Power Automate:

Are you ready to discover the joy of automation?

Whether you have a project in mind or just want to know how we can help, we’re happy to have a conversation

How our Power Platform Development services can help

If you need help implementing HTTP requests, custom connectors or any type of integration between Power Automate and external systems, contact us and we’ll be more than happy to have a conversation and see how we can be of help to your team.

Author
Power Platform Consultant | Business Process Automation Expert
Microsoft Certified Power Platform Consultant and Solution Architect with 4+ years of experience leveraging Power Platform, Microsoft 365, and Azure to continuously discover automation opportunities and re-imagine processes.