I have a single page web application that comes with www.example.com. This is a web application.
- need to make AJAX requests against another server named
api.example.com - it must set certain header fields, such as
Authorizationwhen sending requests toapi.example.com - it should be compatible with recent and not very recent browsers (e.g. IE> = 8)
This all works by processing CORS requests on api.example.com using Chrome (and other recent WebKit-based browsers) using XMLHttpRequest. IE older than version 10 does not implement CORS for XMLHttpRequestand instead provides a non-standard object XDomainRequestfor cross-domain requests, but XDomainRequestdoes not implement a way to set an HTTP header .
So my question is: how do I make cross-domain queries with custom headers without using XDomainRequestor XMLHttpRequest? What is the best way to solve the problem?
Edit: I have control over all the servers involved (* .example.com).
source
share