How to test if an image was returned in the response?

App information

  • App Type [Native App]
  • Postman Version [7.3.4]
  • OS: [macOS Mojave 10.14]

If you run a get request, no special edits needed, on you’ll receive an image through the IIIF (international image interoperability framework) image API endpoint… I’m working on replacing how this image is served and want to check response times with the replacement compared to how it works now.

I would like to run a GET request test inside one of my collections but I’m not sure what the code would be in the “Tests” tab. Executing the GET with the above link (old implementation), Postman shows the image, but says “This request does not have a body.” When I enter in the new request URL (new implementation), I’d just like to test I still receive an image in the body and then compare the speeds.

I’m assuming I could test Content-Type = image/jpeg; but again, this is my first day with Postman and I’m a noob. I’d like to use this as a substitute for setting up an entire JMeter test

I’m using this to test that content-type is there, but not sure how to check its value.

pm.test("Content-Type header is present", function () {"Content-Type");

SOLVED""Content-Type", "image/jpeg; charset=UTF-8")