Reputation: 91189
Accept
header.Earlier this year, someone was in the same boat, and got the response
You cannot do it using javascript capabilities, since javascript has no permission to write on client machine, instead you can send request to server to create csv file and send it back to client.
So I added a button that does
window.open("MyWebService.cgi?" + theSameQueryStringIPassedInTheAjaxCall)
,
which opens the HTML version in a new browser tab. I want the CSV version. Is there a way I could pass an Accept: text/csv
HTTP header? (I know how to do it with XMLHttpRequest and setRequestHeader, but that doesn't help me.)
Upvotes: 1
Views: 2212
Reputation: 32831
Don't think so. I think you should use an parameter instead.
Upvotes: 1