Usually I'm able to sniff my HTTP requests using Chrome Dev Tools - network tab.
But it's not happening for download-files (i.e. when Content-Dsiplosition
is set to Attachment;filename=xxx
) - then Chrome just downloads the file and nothing is shown on the network tab.
How do I see those? I mean, in Chrome, without any 3rd party tools like PostMan.
PS. I need to see the headers my server sends, there's some debugging info I need.
To view the request or response HTTP headers in Google Chrome, take the following steps : In Chrome, visit a URL, right click , select Inspect to open the developer tools. Select Network tab. Reload the page, select any HTTP request on the left panel, and the HTTP headers will be displayed on the right panel.
When I try to paste an URL pointing to a downloadable file, directly into the browser address, it doesn't show anything on the network tab.
However, I've found a workaround that suits my use case. Create an .html file anywhere, and just create a link to that attachment (an alternative is to just open about:blank
in the browser and edit the HTML in place).
<a href="https://example.com/example.ambiguous.file">download</a>
Then open that .html file and click on the link.
This causes the network tab to display the file you're trying to download, and so the headers.
In my case I was able to troubleshoot how the Content-Disposition
headers was never sent to specific browsers.
EDIT (2017-11):
If this doesn't work with recent versions of Chrome, try putting it in an image tag. The objective is to sniff the HTTP response headers, not the content.
<img src="https://example.com/example.ambiguous.file">download</img>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With