How to display the function GETHEADR

How to display the function GETHEADR

book

Article ID: KB0071199

calendar_today

Updated On:

Products Versions
ibi WebFOCUS WebFOCUS 9.x

Description

How to display the function GETHEADR

Issue/Introduction

How to display the function GETHEADR

Environment

WebFOCUS version 9.X

Resolution

The HTTP Headers are available to the WebFOCUS client, but are not automatically passed to the Reporting Server. 

Create two procedures - you need to run on the Reporting Server (http://localhost:8121)

1. - acceptlanguage.fex

-* This works only if called directly on the Reporting Server
 -SET &ECHO='ALL';
-SET &VARHEADER=GETHEADR('accept-language', 'A50');
 
-HTMLFORM BEGIN
<!DOCTYPE html">
<html>
        <head>
        </head>
        <body>
        <h1>GETHEADER accept-language</h1>
        Today: !IBI.AMP.DATE;<br>
        Header accept-language:
                 !IBI.AMP.VARHEADER;
        </body>
</html>
-HTMLFORM END
 
-EXIT

Output:

GETHEADER accept-language
Today: 06/23/23
Header accept-language: en-US,en;q=0.9,ja;q=0.8


2. - useragent.fex

-* Works only on the Reporting Server side
-SET &ECHO='ALL';
-SET &USER_AGENT=GETHEADR ('user-agent', 'A256');
 
-HTMLFORM BEGIN
<DOCTYPE html>
<html>
        <head>
        </head>
        <body>
        <h1>GETHEADER user-agent</h1>
        TODAY: !IBI.AMP.DATE;<br>
        Header user_agent: !IBI.AMP.USER_AGENT;
        </body>
</html>
-HTMLFORM END
 
-EXIT

Output:

GETHEADER user-agent
TODAY: 06/23/23
Header user_agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36


Attached procedures and video file.

Otherwise, you will have to pass the header from the client with Custom Settings:
Ref.: https://docs.tibco.com/emp/wf-wf/8207.27.0/doc/pdf/TIB_wfwf_8207.27.0_security_administration.pdf#page=682
Appendix G. Manipulating WebFOCUS Variables
p. 682 CopyHTTPHeaderToWFVar Method

Additional Information

Ref.: https://docs.tibco.com/emp/wf-wf/8207.27.0/doc/pdf/TIB_wfwf_8207.27.0_security_administration.pdf#page=682

Attachments

How to display the function GETHEADR get_app
How to display the function GETHEADR get_app
How to display the function GETHEADR get_app