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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

Accessing response headers from tRest

Hi,

 

I need to access to my response header with tRest component, not the tRestClient.

I use ((java.util.Map<String,java.util.List<String>>)globalMap.get("tREST_1_HEADERS")).get("Set-Cookie").get(0).toString()

But I have a result of NullPointerException..

 

Maybe you'll have a solution for me, thanks

Labels (4)
1 Solution

Accepted Solutions
navds
Creator II
Creator II

Use a tFixedFlowInput with null values.

View solution in original post

4 Replies
navds
Creator II
Creator II

Hi, tREST does not have this variable. Use tRESTClient instead.

 

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

Hope it helps.

Anonymous
Not applicable
Author

Yes I know but when I use tRestClient, the problem is I need to input JSON in the body, so I use a tJavaRow or a tMap to output throught the tRestClient BUT tJavaRow or tMap need an input (an entry) too, and I do not have anything to put in entry because my JSON is generated with context data. 

 

So for the moment I have put a tFileInputDelimited with a input.txt before the tJavaRow without anything inside it, but it's not pretty... Do you have a solution, I hope you'll understand my problem.

 

Thanks 


Capture.PNG
navds
Creator II
Creator II

Use a tFixedFlowInput with null values.

Anonymous
Not applicable
Author

Yes thanks that's ok but it would be better if we could get the headers from a tRest...

 

Thanks