Complete the code to send a GET request to the URL.
pm.sendRequest({ url: '[1]', method: 'GET' }, function (err, res) { pm.expect(err).to.be.null; });The URL must be a valid string for the GET request. Option A is the correct URL string.
Complete the code to check the response status is 200.
pm.sendRequest('https://api.example.com/data', function (err, res) { pm.expect(res.status).to.equal([1]); });
Status code 200 means the GET request was successful.
Fix the error in the code to correctly parse JSON response body.
pm.sendRequest('https://api.example.com/data', function (err, res) { let data = res.[1](); pm.expect(data).to.be.an('object'); });
text() returns raw text, not parsed JSON.body() which is not a method.The method json() parses the response body as JSON.
Fill both blanks to check the response has a JSON property 'name' with value 'John'.
pm.sendRequest('https://api.example.com/user', function (err, res) { let data = res.[1](); pm.expect(data).to.have.property('[2]', 'John'); });
text() instead of json().Use json() to parse the response and check the property 'name'.
Fill all three blanks to send a GET request, parse JSON, and assert the 'status' is 'success'.
pm.sendRequest({ url: [1], method: '[2]' }, function (err, res) { let result = res.[3](); pm.expect(result.status).to.equal('success'); });The URL is the API endpoint, method is GET, and json() parses the response.
