× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



You have two options to get HTTP header value.

The first one is the one you mention. You do not have to do anything with
HTTP server config. In the deployment panel, you specify the header you
want (does not matter what case since HTTP headers are case-insensitive).
In your case you would specify "X-REQUEST-ID", not "HTTP_X-REQUEST-ID".
Then in your code you would get the environment variable by prefixing it
with "HTTP_". Here you would need to ensure that everything is in upper
case.

The other way is to simply inject an input parameter with the HTTP header
input source (*HEADER_PARAM) value you want.


"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 03/31/2020 09:28:46
AM:

From: Suren K <suren7437@xxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 03/31/2020 09:29 AM
Subject: [EXTERNAL] [WEB400] Reg: Header Parameters in IWS
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

Hi All,

I am stuck with Header Parameter value retrieval using IWS. It would be
a
great help if some one provide me some lights to proceed further.

As per the IWS manual "HTTP headers indicates what transport headers
(e.g.
HTTP headers) to pass to the web service
implementation code. Transport headers are passed as environment
variables.
The environment variable
name for HTTP headers is made up of the specified HTTP header prefixed
with
HTTP_, all upper-cased.
For example, if Content-type is specified, then the environment variable
name would be
HTTP_CONTENT-TYPE. If an HTTP header was not passed in on the web
service
request, the environment
variable value will be set to the null string."

So I created a new HTTP Header in the IWS Step 7 (Specify Transport
Information to be Passed) as HTTP_X-REQUEST-ID

I am passing the header parameter from client as (X-Request-Id =
123456789)

So here my assumption is, an Environment Variable will be created with
name
HTTP_X-REQUEST-ID with value as 123456789. When try to fetch the
Environment variable value in my RPG program i am getting the value as
NULL.





As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.