Question: when using RESTinstance and store String to variable, it store value with square brackets and single quotes, how can I remove square brackets and single quotes at beginning and end? #71
Hello, when using RESTinstance and store String to variable, it store value with square brackets and single quotes, how can I remove square brackets and single quotes at beginning and end?
POST /login {"username":"user", "password":"pass"}
Integer response status 200
${resp} = String $.response.token
log to console response token is: ${resp} # this gives [' zdWIiOiJhaW50 '] I just want zdWIiOiJhaW50
I need to pass the token to next request, but it failing due to extra square brackets and single quotes.
I ended up using split string to characters into an array then accessing the first item in array, this way it got rid of the square bracket and single quote.
Hello, when using RESTinstance and store String to variable, it store value with square brackets and single quotes, how can I remove square brackets and single quotes at beginning and end?
POST /login {"username":"user", "password":"pass"} Integer response status 200 ${resp} = String $.response.token log to console response token is: ${resp} # this gives [' zdWIiOiJhaW50 '] I just want zdWIiOiJhaW50
I need to pass the token to next request, but it failing due to extra square brackets and single quotes.