S Butler
Posts: 0
Joined: Mon Nov 17, 2014 4:44 pm

Adding static text to mapped value

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!!

Evgene Karachevtsev
Posts: 12
Joined: Mon Apr 28, 2014 1:12 pm

Adding static text to mapped value

Hello!

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

Bruce Stuart
Posts: 0
Joined: Fri Oct 24, 2014 4:42 am

Adding static text to mapped value

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

return "Bearer " + value ;

Return to “Issues”