12

Is it possible to preview images for the Image URL responses in postman? If postman doesnt have such settings, then is there any plugins as such for that? Otherwise, suggest some tool which can help do. This is very much needed for an application that I am developing, so please help.

2 Answers2

7

This can be achieved using the pm.visualizer option and then setting the template to use basic img src HTML in the "Test" tab.

Example;

Free API that returns an image URL: https://dog.ceo/api/breeds/image/random

const jsonData = pm.response.json().message
pm.visualizer.set(`
<body>
<img src="${jsonData}">
</body>`);

enter image description here

If you then click on the "Visualize" tab you'll see the image...

enter image description here

w4dd325
  • 527
  • 5
  • 21
0

I'm using Postman V10.4.5. It works by default without any additional configuration.