Skip to main content
March 18, 2024
Solved

Capture Content-Length from an http request

  • March 18, 2024
  • 2 replies
  • 0 views

Hi,

I'm calling MsGraph API from Appian in a two steps methop, I have to send the content-length from the previous integration as a header information in another call.

How can I capture or insert into a variable an http request from an integration? Or are some way to calculate the content-lenght?

Regards

Best answer by angelg0002

Hi Varun,

In my case, I didn't have the content-length on the header from the reply.

So finally I had to create a Web Api where I configurate an a!httpresponse() where I give the content-lenght on the header. After I created an integration where the environment call to itself and take de content-length, and then I can use it to call MsGraph API.

Thnaks

2 replies

varuntejg243705
March 19, 2024

Hi [mention:227ea0cd347241cd9a39ef51e5fb9b5d:e9ed411860ed4f2ba0265705b8793d05] ,

After you call an integration, data will be like the below picture.




Please check the below expression, to index the content length of Integration.


index( index( index( rule!KKK_QueryReferenceData(), "result", {} ), "headers", {} ), "Content-Length", {} )

if you want to make it to integer, just use tointeger().

angelg0002AuthorAnswer
May 14, 2024

Hi Varun,

In my case, I didn't have the content-length on the header from the reply.

So finally I had to create a Web Api where I configurate an a!httpresponse() where I give the content-lenght on the header. After I created an integration where the environment call to itself and take de content-length, and then I can use it to call MsGraph API.

Thnaks