Hi all,
making a https get call and it reporting a null body as a response
Code:
const Url = new URL(systemUrlPort + '/v1/content-hub-service/mobile/sports/nextToGo');
Url.searchParams.append('jurisdiction', state);
console.log("Url: " + Url.toString());
// call the url with parameters
const resp = http.get(Url.toString());
// add response times to custom transaction.
const respCheck = check(resp, {
'status is 200': (r) => r.status === 200,
'response body': (r) => r.body.indexOf('nextToGo') !== -1,
});
return SportsNextToGo;
error I am getting:
ERRO[0010] TypeError: Cannot read property 'indexOf' of undefined or null
When I run the script with --http-debug=full it returns a correct header and response body.
When I copy the URL into a browser it works fine as well.
Any ideas as to where Iām going wrong?