"Connection" header being ignored on REST consumed web services

Hi guys,


I would like to know if you guys have faced this situation and if so, if you have any suggested workaround.

I was consuming a REST API and setting the header Connection to set up with the commonly used value keep-alive.

Nonetheless, this particular header is ignored by the platform.

I tested in the following scenarios all with the same result - header does not go on the request:

  • Testing the REST call in Service Studio, setting up Connection as a test parameter;
  • Checking full troubleshoot Service Center logs after calling this header as a parameter;
  • Checking full troubleshoot Service Center logs after setting this header on the OnBeforeRequest.

In all those cases, this particular header is ignored.

Am I missing something, is there a workaround or is this behavior is by design?


Thanks in advance.

João Marques

Hi João,

Setting the Connection header in the OnBeforeRequest should work like follows:

OnBeforeRequest flow:

Set the HTTP Header local variable:

Append the HTTP header to the Request.Headers list:

This should normally work.

Regards,

Nordin

Hi Nordin,


Thanks for your answer.

As I mentioned on the post, I had tried this approach but also did not work as I could see on full integration logs that the Connection header was ignored.


Cheers,

João 

Hi João,

I assumed maybe you had overlooked something in your logic. 

I've tried this just now for another API and it did show me the Connection header in the full integration log, so I'm not sure then why it's not working for you.

Regards,

Nordin


Hi Nordin,


I double checked what I was doing and it is exactly what you suggested.

I am using my personal environment, are you as well?

On my logs, on the request part, I only see the User-Agent going on the request:


Cheers,

João

Hi João,

Sorry I must have looked to quick as the Connection header is in the response, not in the request. I'm using my personal environment as well.

Funny thing is, if I add the Content-Type header in the OnBeforeRequest, I can find it in the request part of the integration log.

So it looks like you're right and this behavior is by design or a restriction for PEs maybe?

Regards,

Nordin

Other headers work fine, such Content-Type. This one in particular does not which hints it is by design or something is overriding when one sets it.


Cheers,

João

Yes, you're maybe right.

I will try it out on an On-Premises environment later on to see if the result is the same.

Regards,

Nordin

Solution

I have submitted a support case to OutSystems which confirmed the Connection header is not accepted by design. There is a workaround however for that. The answer of OutSystems in the support ticket below:


We have confirmed that it's not possible to add the 'Connection' header through the simple customization, as you have tried. The platform is ignoring this particular header when setting the Request Headers. This was a design choice, as this particular header is only used in HTTP 1.0.

If you truly need to apply the 'Connection' header', you might be able to achieve it using the Advanced Customizations but it would involve a more complex process and additional development effort.


Regards,
João

Solution

Thanks for leaving this information here João. Did you get a chance to try out the workaround?

Regards,

Nordin