I am trying to send a CORS request for a JSON payload. I control both the server and the client.
I'm following along here: https://developer.mozilla.org/en-US/docs/HTTP/Access_control_CORS?redirectlocale=en-US&redirectslug=HTTP_access_control
The server has a custom header that must be sent along with every request. This custom header therefore makes the request 'not simple' and thus the request must be preflighted with an OPTIONS request.
I can see jQuery making the OPTIONS request, but it doesn't send the custom header along.
Methods I've tried:
- Using the beforeSend option: http://api.jquery.com/jQuery.ajax/
- Using an AJAX prefilter: http://api.jquery.com/jQuery.ajaxPrefilter/
In both cases, the browser is not sending the custom header along.
I'm using FF 17.0.1, jQuery 1.8.3.