286
Views
10
Comments
How to add custom request header in my URL
Question
Application Type
Reactive

Hi,

I've to add custom request header parameter to my URL, as I'll be receiving some information when customer lands on my application so Instead of adding a query parameter client suggested us to add custom request header parameter to my URL, ca anyone suggest how to add this to my home page URL


Thanks,

Sandeep.

2022-08-03 04-32-50
Ravi Punjwani

Hi Sandeep,

Configure fetching your Request Header using this server action. You'll only need to pass the request header's parameter HeaderName. If they passed it in the request header, it will be accessible here.

Add dependency to HTTPRequestHandler module > Server Actions > GetRequestHeader, and use it to get the header value.


2025-03-19 01-45-51
Sandeep Kumar Kolli

Hi @Ravi Punjwani we've already created the above mentioned logic, all I wanted to make sure is that, we don't need to add anything from our end right? they've pass the header parameter with the value, all we need to capture the header with the key right.

2022-08-03 04-32-50
Ravi Punjwani

Yes that should be all good. To make sure from your end, just try your application URL from Postman by adding the required request headers and send request via GET method. You should be able to receive the request headers in your reactive app, as sent from Postman.

2025-03-19 01-45-51
Sandeep Kumar Kolli

Hi, what if the same needs to be done vice versa, I mean if I need to call the other application URL from outsystems end by adding one extra custom header parameter.

2022-08-03 04-32-50
Ravi Punjwani

Hi Sandeep,

Do you mean redirecting your browser's webpage to another URL including a request header? Or consuming a REST API with adding a Request Header?

2025-03-19 01-45-51
Sandeep Kumar Kolli

Hi @Ravi Punjwani We've to call another URL by adding one custom header to it.

2022-08-03 04-32-50
Ravi Punjwani

Hi Sandeep,

I know you've to call another URL (as you mentioned in the previous comment), which is why I'm asking you to understand your correct scenario.

  1. Calling a URL from browser by redirecting to that URL
  2. Calling a URL via GET or POST in Consume REST API and receive a response

Which situation applies to you?

2025-03-19 01-45-51
Sandeep Kumar Kolli

Hi, I've to call another URL from my outsystems application using redirect node.

2022-08-03 04-32-50
Ravi Punjwani

Hi Sandeep,

Please read this answer if you're trying to redirect from browser to external URL
https://stackoverflow.com/a/35237462/1500601

I don't think it will be possible at all

UserImage.jpg
Sadikul Sayed

How to achive the the same in Service Action. Using HTTPRequestHandler module > Server Actions > GetRequestHeader the new header not coming in response, nither able to read addithonal header in  Service Action

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