{"id":38102,"date":"2016-07-25T15:52:50","date_gmt":"2016-07-25T10:22:50","guid":{"rendered":"http:\/\/www.tothenew.com\/blog\/?p=38102"},"modified":"2016-07-26T11:03:59","modified_gmt":"2016-07-26T05:33:59","slug":"make-your-rest-api-internet-explorer-compatible","status":"publish","type":"post","link":"https:\/\/www.tothenew.com\/blog\/make-your-rest-api-internet-explorer-compatible\/","title":{"rendered":"Make your REST API compatible with Internet Explorer"},"content":{"rendered":"<p>You might wonder when you find your REST\u00a0API&#8217;s are working properly in all browsers and rest clients but not in IE. I got the same issue in my project. I am sharing the issue and solution with you so that you can resolve it if you get the same.<\/p>\n<p>In rest APIs, I had some parameters in header for user validation and other region related like X-Auth-Token, Content-Country. In the front end, we are using AngularJS for API\u00a0consumption, so we were getting proper results in all browsers except IE. IE was showing following error in console:<\/p>\n<p><code>SEC7123: Request header content-country was not present in the Access-Control-Allow-Headers list.<\/code><\/p>\n<p>IE makes headers in small case whether it entered in capitalized case. To resolve this issue I have made changes in CORS filters in application side. I changed capitalized headers to small case headers. like this.<\/p>\n<p><code>response.setHeader(\"Access-Control-Allow-Headers\", \"x-auth-token, content-country\");<\/code><\/p>\n<p>After making the above changes, my APIs are working properly in all browsers.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You might wonder when you find your REST\u00a0API&#8217;s are working properly in all browsers and rest clients but not in IE. I got the same issue in my project. I am sharing the issue and solution with you so that you can resolve it if you get the same. In rest APIs, I had some [&hellip;]<\/p>\n","protected":false},"author":818,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":4},"categories":[446,1],"tags":[3787,3786],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/38102"}],"collection":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/users\/818"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/comments?post=38102"}],"version-history":[{"count":0,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/posts\/38102\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/media?parent=38102"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/categories?post=38102"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tothenew.com\/blog\/wp-json\/wp\/v2\/tags?post=38102"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}