Cors issue specifically in Internet Explorer XMLHttpRequest: Network Error 0x80070005, Access is denied


Cors issue specifically in Internet Explorer only when calling API from ajax call.

1)Request header content-type was not present in the Access-Control-Allow- Headers list 2)XMLHttpRequest: Network Error 0x80070005, Access is denied.

I tried by followings

   xhrFields: {
     withCredentials: true

also by setting ...

  • crossDomain: true
  • ...
  • headers: { 'Access-Control-Allow-Origin': '*' },
  • Ajax call

        var url = "https://dev-connectivity.dummylink";
     var data = JSON.stringify({    
        "lang": "en",
        "ClientId": "asdfasf3452345c42352345c",
        "CountryCode": "34"
        url: url,
        type: 'POST',
        contentType: 'application/json; charset=utf-8',
        headers: {
            'Access-Control-Allow-Origin': '*' },
        data: data,
        success: function (data) {
        error: function (error) {

    //My api Webconfig code

          <remove name="Access-Control-Allow-Origin" />
          <add name="Access-Control-Allow-Origin" value="*" />
          <add name="Access-Control-Allow-Methods" value="*" />
          <add name="Access-Control-Allow-Headers" value="*" />

    // also Enabling Cors in startup

              services.AddCors(o => o.AddPolicy("CorsPolicy", builder =>


    asked on Stack Overflow Apr 23, 2019 by Irfan Ullah

    1 Answer


    IE doesn't accept Content-Type header if you have provided * in you web.config file so to fix this issue, you need to manually add Content-Type header in Access-Control-Allow-Headers list inside your web.config file.

         <remove name="Access-Control-Allow-Origin" />
         <add name="Access-Control-Allow-Origin" value="*" />
         <add name="Access-Control-Allow-Headers" value="Content-Type, Any-Other-Header" />
    answered on Stack Overflow Apr 24, 2019 by Ask

    User contributions licensed under CC BY-SA 3.0