Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
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.
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
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")