I have a window.open command like this:
window.open("http://MyServer/MyPage");
And I know that I can set accepts
of a request, using something like this:
var client = new XMLHttpRequest();
client.open("GET", "http://MyServer/MyPage");
client.setRequestHeader("Accept", "ContentTypeName");
client.send();
Now I need to combine this two things. But I don't know how. So...
How can I set accepts in HTTP header to a call executed by a window.open command?
UPDATED
Here is a very similar question to that: window.open with headers.
And is already answered.
But as the answer suggests I write in my new window, will be not possible if my content type is a binary like:
- application/pdf
- application/vnd.ms-excel
- application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
That for my needs these types will be present. So anyone know how I can do it?