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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / HTTP request - Double ...
Power Automate
Unanswered

HTTP request - Double quotes inside the Body get replaced by escape and double quotes instead

(0) ShareShare
ReportReport
Posted on by 31

Good morning Community

 

I am building a flow that needs to send a CSV file to an endpoint, I have managed to built the request meeting all the requirements from the vendor, however, when the request is sent then fails. Looking at the raw data that gets sent to the API in the POST request, I noticed that every part of the body that contains double quotes, get replaced with /"value"/, and this is the cause of the failure. This API is very sensitive.

 

Is there any way I can change this so the double quotes are left intact?, please see below the screenshot of the flow and the raw data that gets generated:

 

acharry_0-1681467430068.png

 

The body I am sending is this:

--fileboundary
Content-Disposition: form-data; name="module"

InternalTest
--fileboundary
Content-Disposition: form-data; name="import_template_id";

XXXXX
--fileboundary
Content-Disposition: form-data; name="payload"; filename="API_data_Test.csv"

 

This is the body being sent to the API, I highlighted in red what needs to be kept in only double quotes:

"body":" --fileboundary\r\nContent-Disposition: form-data; name=\"module\"\r\n\r\nInternalTest\r\n--fileboundary\r\nContent-Disposition: form-data; name=\"import_template_id\";\r\n\r\nXXXXXXXX\r\n--fileboundary\r\nContent-Disposition: form-data; name=\"payload\"; filename=\"API_data_Test.csv\"\r\n\

 Is there any way I can keep the body as I am drafting it above?

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    I don't think you can send a CSV as form-data. Probably needs to be sent as binary, likely base64 encoded.

  • acharry Profile Picture
    31 on at

    Thank you for your reply.

    My current problem isn't the CSV data but the Body structure. Power Automate takes all the values wrapped in double quotes and replace them with escape quotes when sending the request as shown above.

     

    It is a very sensitive endpoint and I have to send the data as I've shown in the screenshot, otherwise it rejects it.

  • lbendlin Profile Picture
    8,474 Super User 2025 Season 2 on at

    Do you have access to the endpoint's logs?  Wonder how the request comes through IRL. Maybe the escaping only happens in the Power Automate UI.

  • acharry Profile Picture
    31 on at

    Hi Ibendlin, thank you for your comment.

     

    What do you mean with IRL? I am not really sure what you mean or how to check it. I am looking at the Input data that I can see in the request which is the one I attached to this post.

     

    acharry_0-1681725564650.png

    "body":" --fileboundary\r\nContent-Disposition: form-data; name=\"module\"\r\n\r\nInternalTest\r\n--fileboundary\r\nContent-Disposition: form-data; name=\"import_template_id\";\r\n\r\nXXXXXXXX\r\n--fileboundary\r\nContent-Disposition: form-data; name=\"payload\"; filename=\"API_data_Test.csv\"\r\n\

    The server is giving me an Internal Server Error but nothing more. 

     

    Many thanks,

     

    Angelica

  • Verified answer
    acharry Profile Picture
    31 on at

    I have managed to fix my issue, after going in loops and chasing ghosts, here is the answer to this.

     

    Firstly, the quotes weren't an issue, the HTTP request is intelligent enough to understand the format and the scape is only how the UI displays it.

     

    For this to work, I had to change the body of the request, first, I created and initialized a variable of type JSON, inside it I entered the body of the HTTP request, and in there I specified the CSV file or content that I want to send in my POST request, which I think was causing the issue, so now it looks like this:

    acharry_0-1685723769195.png

     

    Then, I just used the variable above in my HTTP request as per screenshot below:

     

    acharry_1-1685723897533.png

    And after this, the workflow worked successfully doing the POST request as expected.

     

    In the end, things were much easier than I initially thought.

     

    Thanks,

     

    Angelica

     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard