Although my previous comment about the apim.output function argument is valid in that it should describe the output that you're writing, ie, text/plain instead of */*, it is not the cause of your issue. The cause is a simple case sensitivity issue. In v5, request headers are saved internally with lower cased names, and apim.getvariable is case sensitive. Simply change
var store = apim.getvariable('request.headers.Authorization');
to
var store = apim.getvariable('request.headers.authorization');
and your header value should be available to you.
Regards,
Steve
------------------------------
Steve Linn
Senior Consulting I/T Specialist
IBM
------------------------------
Original Message:
Sent: Tue November 16, 2021 05:15 AM
From: Akshay Sawant
Subject: unable to capture value from request header using gateway script
Hello Everyone,
We have created two parameter(Authorization, Checksum) which is passed through request header & we want to validate value using gateway script.
We used below code to capture value from request header
var store = apim.getvariable('request.headers.Authorization');
session.output.write(store);
apim.output('*/*');
but getting undefined response from APIC v5 in IBM cloud.
so please advice for the same
------------------------------
Akshay Sawant
------------------------------