Quantcast
Channel: Internet Explorer 8, 9, 10, 11 forum
Viewing all articles
Browse latest Browse all 10469

Custom HTTP Request Header for IE8

$
0
0

I want to set some custom HTTP Request Header for IE8. I used XMLHttpRequest to set the request header, but I received Object doesn't support this property or method error message.

I think IE8 used XDomainRequest instead of XMLHttpRequest. Same goes to $.ajax, it failed to set the custom header.

Is there any way to set custom Http Request Header for IE8?

Sample I used with XMLHttpRequest:

var xhr = new XMLHttpRequest();
xhr.open("GET", "http://some.url", true);
xhr.setRequestHeader("CUSTOM", "custom");
xhr.send();
Sample I used with $.ajax:

$.ajax({
    url: "http://some.url",
    headers: {
        'CUSTOM': "custom"
    },
    type: "GET",
    success: function(result, status, xhr) {
    },
    crossDomain: true
});

For XDomainRequest, when I tried to use the .setRequestHeader(). I get the error message Object doesn't support this property or method. Seems like XDomainRequest has limited functions.



Viewing all articles
Browse latest Browse all 10469

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>