Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Toronto Sept 9th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

How to get tREST HTTP header value from property file.

Hi.

I'm calling a web service API using a tREST component.

HTTP request header contains an authentication token.

 

I want to set this dynamically by reading it from a file instead of the built-in.

What should i do?

 

Thank you.

 

0683p000009M7HB.png

Labels (3)
3 Replies
Anonymous
Not applicable
Author

Hello,

You could access to your response header with tRESTClient.

((java.util.Map<String,java.util.List<String>>)globalMap.get("tRESTClient_1_HEADERS"))

 Best regards

Sabrina

TRF
Champion II
Champion II

Get the token from the file with the following subjob to populate a global variable (for example a global variable called "token"):

tFileInputDelimited --> tFlowToIterate (do not use "default" to decide by yourself for the variable name).

Then in the tRest's value for the Value field, get the global variable value with the followinb expression:

(String)globalMap.get("token")
Anonymous
Not applicable
Author

I don't have enough skills to see this and create a job...
Does the key read from the file?