Mock Server - Get Image / File Option

My question: I am using the Mock Server setup for very basic API calls, so as example sending through an order number and receiving back a text update such as “your order is due tomorrow”. This is fine and I have this working however, I would now like to be able to call product info and it come through either as an image or in file format such as a PDF. Really struggling to find any sort of sample to this being done previously. The best I have come up with is a simple API call, where it returns a random image link through the faker library - issue here is all I receive is a URL link and not the actual image which is my objective.

if someone can assist and provide screenshots of an example in Postman that would be really useful

1 Like

We’re having the same issue so I thought I would add a reply here instead of starting my own thread.

We are using Postman to mock a 3rd party API. We uploaded the Open API specs and created mock servers and everything seems to work ok for REST and JSON.

What we can’t do is mock an endpoint that returns a PDF. I think the issue is that Postman example responses can only be text. There’s no such thing as “response types”, it’s just a raw text field. I think a PDF is not really representable as text i.e. you can’t just open it in Notepad and copy/paste the contents into the example response box.

Is there any way to return a file from a mock server?