Poonam
Poonam

Reputation: 186

Not able to extract value from the response and use it in next request using JSON extractor

Here is the reponse and i want to extract the id from it

{"status":"success","data":{"name":"chirag","salary":"1000","age":"30","id":82}}

this is how i am trying to extract:

enter image description here

then use it in the next request like this:

enter image description here

Update: When i use this in this in the next request - api/v1/delete/${id}, I get this error:

Thread Name:Delete Employee 5-1
Sample Start:2020-07-19 11:27:54 WEST
Load time:0
Connect Time:0
Latency:0
Size in bytes:1115
Sent bytes:0
Headers size in bytes:0
Body size in bytes:1115
Sample Count:1
Error Count:1
Data type ("text"|"bin"|""):text
Response code:Non HTTP response code: java.net.URISyntaxException
Response message:Non HTTP response message: Illegal character in path at index 47: http://dummy.restapiexample.com/api/v1/delete/${id}

Upvotes: 1

Views: 244

Answers (1)

Yugal
Yugal

Reputation: 424

To Extract... modify the "json path expression" as:

$.data.id OR $..id

Then in subsequent request, correct the path:

/api/v1/update/${id}

Upvotes: 1

Related Questions