Hi Team, I have two requests I should pass all the response values from the first to the second request body area.
I have created a variable called “response2” and set the response in a variable, but when I am passing a response value in the second request body. i am getting some errors and looks like value is not passed from first request response
1 request tests area :
if (pm.response.code == 200 ) {
pm.test(“search contract is successful”, function () {
var jsonData = pm.response.json();
pm.globals.set(“response2”, jsonData);
console.log(pm.globals.get(“response2”));
});
}
if (pm.response.code == 200 ) {
pm.test("search contract is successful", function () {
var jsonData = pm.response.json();
pm.globals.set("response2", JSON.stringify(jsonData));
console.log(pm.globals.get("response2"));
});
}
P.S - Kindly drop in the detailed error messages/screenshots when you post for next time. Because just in an assumption I have provided the response here, to avoid it in future kindly go through this before raising a query
Please let me know if you have still issue with this
Hi @bpricilla, I have applied the above code, still, the error is persisting.
when i checked the console. request body is not passed the value correctly. value is passed an object.