Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Automate - Using Flows
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

  • special-analyst Profile Picture
    18 on at
    Re: HTTP header: Content-Length integer is changing to string when flow runs

    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?

  • v-jefferni Profile Picture
    on at
    Re: HTTP header: Content-Length integer is changing to string when flow runs

    Hi @SJacobs ,

     

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

     

    Best regards,

  • Verified answer
    SJacobs Profile Picture
    71 on at
    Re: HTTP header: Content-Length integer is changing to string when flow runs

    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.

     

     

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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,702 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,026 Most Valuable Professional

Leaderboard

Featured topics

Restore a deleted flow