Hi Everyone,
I need to render the pdf file in Visualizer which was a response to a GET callout. The Content-Type is application/octet-stream. I searched but couldn’t get help on this.
Hi Everyone,
I need to render the pdf file in Visualizer which was a response to a GET callout. The Content-Type is application/octet-stream. I searched but couldn’t get help on this.
I think the PDF support in Postman only really applies to the response tab and only if the content type in the response header is set to application/pdf.
On a side note, if the API is returning an file with an PDF extension, then the API should not be sending this as application/octet-stream. That is generally used for “arbitrary binary data” aka an unknown format. application/PDF has been around for quite a while now and the API should be able to handle the correct content type. If you have any control over the API, you may be able to discuss this with the developer.
Postman can’t natively render unknown file types (and its the content header that drives this, not the extension of the file which could be faked). I wouldn’t expect it to either as that is how a lot of viruses spread by being executed under the wrong context.
It looks like it actually disables the pretty\raw & visualizer views when it does recognise the PDF content type.
There is potentially a way using Visualizer and I would recommend the following YouTube clip as a starter for 10 on that. (It’s an advanced subject though).
How to Upload, Download, and Preview Files (PDFs) with Postman - YouTube
Thanks for the explanation. Previously it was application/pdf but now it has changed to application/octet-stream. I’ll connect with the team and will discuss this.
Thanks.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.