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 / HTTP header: Content-L...
Power Automate
Answered

HTTP header: Content-Length integer is changing to string when flow runs

(0) ShareShare
ReportReport
Posted on by 71

I have a flow with an HTTP action.  The API I am sending the POST request to requires that I include a header called Content-Lengthwith an integer value.  In the screenshot, you can see I'm entering an integer value, but after submit, the value is changed to a string, and the request is rejected for failing to include a valid Content-Length.  I tried entering the value as a formula: int(1101) and I tried a compose action prior to this step where i ensured the value is an integer.

 

I also tried making up a random named header, entered an integer, and it's still getting converted to a string.  Any ideas why this is happening, and how I might force it to remain an integer?  Note that I have tested the same request in Postman and had no issues.

 

How do I create an HTTP request with a header that is a number?  Thanks!!!

 

after.png

91de7429-ad0f-4518-84c8-4f60984c51cd.png

Categories:
I have the same question (0)
  • Verified answer
    SJacobs Profile Picture
    71 on at

    Problem solved.  After more experimentation, I got this to work.  The error was not caused by the Content-Length header data type.  In this case, it turned out that the Accept header, which in the screenshot above shows "*/*" needed to be defined explicitly.  When I changed the value to Accept: application/json, the request was successful.

     

     

  • v-jefferni Profile Picture
    Microsoft Employee on at

    Hi @SJacobs ,

     

    Nice shoot! Please consider accept the apply as solution to help other users easily find it.

     

    Best regards,

  • special-analyst Profile Picture
    18 on at

    I'm facing a very simmilar problem, but happens with a HTTP query. It's value is set to be an integer, but when the flow runs the value becomes a string. I'm gonna try some different "Accept" header values, but I'm already sending the accept header with application/json value. Any other idea?

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Automate

#1
Vish WR Profile Picture

Vish WR 468

#2
Haque Profile Picture

Haque 370

#3
Valantis Profile Picture

Valantis 354

Last 30 days Overall leaderboard