cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SJacobs
Advocate I
Advocate I

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

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

1 ACCEPTED SOLUTION

Accepted Solutions
SJacobs
Advocate I
Advocate I

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.

 

 

View solution in original post

2 REPLIES 2
SJacobs
Advocate I
Advocate I

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.

 

 

Hi @SJacobs ,

 

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

 

Best regards,

Community Support Team _ Jeffer Ni

If this post helps, then please consider Accept it as the solution to help the other members find it.

Helpful resources

Announcements
 WHAT’S NEXT AT MICROSOFT IGNITE 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Register for a Free Workshop.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Users online (1,553)