142
rated 0 times
[
143]
[
1]
/ answers: 1 / hits: 145118
/ 10 Years ago, tue, july 1, 2014, 12:00:00
Update 20140702:
(but I'm marking one of the other answers as accepted instead of my own,
as it got me halfway there, and to reward the effort)
It appears that setting a HTTP request header is not possible through links with <a href=...>
, and can only be done using XMLHttpRequest
.
However, the URL linked to is a file that should be downloaded (browser should not navigate to its URL), and I am not sure is this can be done using AJAX.
Additionally, the file being returned is a binary file, and AJAX is not intended for that.
How would one go about triggering a file download with a HTTP request that has a custom header added to it?
edit: fix broken link
More From » ajax