I'm sending a POST request to an external API which returns a JSON response. But I'm unable to access the JSON property it comes out as undefined however when I print the whole body the property exists. I have tried cloning the body to a new variable but it didn't work. Also tried parsing the JSON again but it didn't work either.
request.post({url:`http://2captcha.com/in.php?key=${key}&method=${service}&sitekey=${sitekey}&pageurl=${pageurl}&json=${json}`}, function(error, response, body){
if (response.statusCode == 200) {
console.log(body);
console.log(body.status);
console.log(body.request);
}
My console
{"status":1,"request":"67055353796"}
undefined
undefined