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

tREST- Using Context Variable in tRest

I am trying to make a POST command using tREST component. When I type in the exact payload to be sent to the server in HTTP Body section, the job works fine and I am able to make the call and get a successful response from the server. But when I store the payload in a string context variable and then put the variables name in the HTTP Body section, I get a http 400 error. Any idea why is this happening?
Labels (3)
2 Replies
Anonymous
Not applicable
Author

Hi,
How did you s tore the pa yload in a string context variable and put the variables name in the HTTP Body section? Could you also post your setting screenshots into forum, please? In this way, we can address your issue quickly.
Best regards
Sabrina
Anonymous
Not applicable
Author

I am using tJavaflex for assigning the context variable. here i is the screenshot of of the java code. Variable s is of string type. As you can see that context.new1 is getting the variable s and context.new2 is being assigned a string directly, which is of the same value as of s ; I printed the value of s on the console and then copied it here.
When tRest is given context.new1 it shows error but works fine with context.new2
    0683p000009MArl.png 0683p000009MAVS.png