Page 1 of 1

Adding static text to mapped value

Posted: Wed Feb 25, 2015 9:23 pm
by S Butler

Hi,

I created a rest service that will log me in to an external database. This returns a sessionId which I have mapped to a local storage variable. Now, when I go to send subsequent requests, I need to specify this sessionId as a header value in these other rest requests. When I map the sessionId local storage variable to the header value in this next request I need there to be specific text ("Bearer") and a space (" ") before the sessionId value. So the mapped value would need to look something like this: Bearer 123456789

Can you help me understand how to do this when mapping the sessionId local storage variable to the header value in the new request? I'm assuming I have to click on the little JS icon next to the header field and add javascript. Just not sure what that looks like.

Thanks!!


Adding static text to mapped value

Posted: Wed Feb 25, 2015 10:01 pm
by Evgene Karachevtsev

Hello!

You need such code:
prereturn 'Bearer ' + value;/pre


Adding static text to mapped value

Posted: Wed Feb 25, 2015 10:09 pm
by Bruce Stuart

Provided you are mapping the local storage variable to the header in the Js it would likely be like this:

return "Bearer " + value ;