I'm trying to extract access token from the body response and use it in Header Manager for authorization. The response of the first request is Response
Then I use regular expression for extracting the token Json Extractor
Then I enter a variable into the Header Manager Header Manager
But when I run the script I receive an error: Listener
Also, I get an error:
2019-02-09 23:45:57,822 ERROR o.a.j.e.j.j.JSONPostProcessor: Error processing JSON content in JSON Extractor, message: Use bracket notion ['my prop'] if your property contains blank characters. position: 2
Error
I assume that json path is incorrect
I have already researched a lot of questions here but they didn't help me What is wrong in my actions? Thanks for the response in advance!
Use JSON Path Expressions as $.access_token
You're using a Regular Expression inside a JSON Extractor, that's your problem.
You must use JSON Path expression instead.
So correct value for JSON Path Expressions is:
$..access_token
Since you have in "Names for created variables" token, you can then use it with:
${token}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With