I have a JS app which makes requests to a server which can return results in JSON or CSV depending on the Accept
header. I'd like for the user to be able to click on a button and download the CSV to the user's hard drive.
Is there some way I can make a request and set the Accept
header?
I know there are other ways I can do it (different resource, query parameters), and I don't what I'm describing is possible, but it would be nice to do it 'correctly' if I can.