Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I'm trying to use a global variable that i defined before as parameter of
POST
httpbody in the tRest component as follows :
but im getting the " unable to decode malformed json "
Do you know a solution ?
Hi
the expression syntax is not right, to use a global variable in a string, the expression looks like:
"...params\":["+(String)globalMap.get("session_id")+"]}"
// BTW, you need [] around the session id value in your case?
Please try again and let me know if it works.
Regards
Shong
i tried your suggestion but i still get the same error.
Yes i need the [] around the session id value because im working with an API that requires the [] in the params value .
Hi
Try to print the value of global variable before it is used to check if it has the right value. eg:
tBufferOutput--main--tSetGlobalVar
|onsubjobok
tJava
on tJava:
System.out.println((String)globalMap.get("session_id"));
In addition, have a try to set a fixed session id in the body string to test if JSON format in body is fine.
"...params\":[your_session_id_value]}"
that is not the issue.. the problem is that the error " unable to decode malformed json " so even if the session_id value is incorrect i should get a response other than the error above
i've also tried to hard code the session key to test the json format and it works fine ..
I'm starting to think its not possible to use a global variable in http body with json format