1113
Views
4
Comments
Get header values from the REST request.
Question

Hi,
I am exposing a REST service.
I need to store the values that are being passed in header by the rest call by client.
I tried to use the GetRequestHeader action in HttpRequestHandler, but that has to be done to get all the headers individually.
I also tried getRequestContent, but it returns the data in raw(text)  format. So a definite structure cannot be made, since the headers may vary for diff apis.
Is there any way I could get the headers in a simpler way (a common action is needed since it is to be used across other API's.)

thanks,
Anagha

2017-12-13 08-27-28
Joey Moree

The only solution I can think of is to use GetRequestContent, strip out the Headers. Create a generic list (key-value struct) from it, with HeaderName, HeaderValue.

That way the value is selectable using the headername.

An alternative solution would be to look up something on the forge, or create it yourself.

2020-02-13 05-29-21
Anagha Chikate

Joey Moree wrote:

The only solution I can think of is to use GetRequestContent, strip out the Headers. Create a generic list (key-value struct) from it, with HeaderName, HeaderValue.

That way the value is selectable using the headername.

An alternative solution would be to look up something on the forge, or create it yourself.

Hey,
The problem is that getRequestContent does not give the response in any particular format. We cannot just strip out the header, since the response is just a text.

Thanks,
Anagha


2025-10-09 15-40-22
Craig St Jean
Staff

Hello Anagha Chikate,

You can get HTTP headers from the current web request via an extension.  I have published a Forge component to help with this: https://www.outsystems.com/forge/component-overview/5772/http-headers

Hope it helps!

2020-04-26 12-28-03
Shailendra Malviya

For rest expose having multiple actions. Can we identify which action is called in OnRequest.. 

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.