When I get the response I would like to check whether is in JSON presented and to add validation for true or false in the test.
Hello @satellite-geoscient2
Welcome to the community
I think you can check it that way
const jsonData = pm.response.json();
pm.test("Check if response is json", function() {
pm.expect(jsonData).to.be.an('object');
});
Hello, I tried doing this, but I got an error when the response was empty: There was an error in evaluating the test script: JSONError: No data, empty input at 1:1 ^
How can I factor that into my tests?