0

I'm trying to make a simple JSON POST with custom header like this :

$.ajax({
    type: 'POST',
    url: 'http://oe.com/social/identity/auth/bydeviceid/AZERTYD',
    dataType: 'json',
    success: function(data) {
        alert('success');
    }
});

I receive the following error:

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'null' is therefore not allowed access.

I've also noticed that my code is sending a OPTIONS request and not POST even I mentioned a POST request. How do I solve this?

Carrie Kendall
  • 11,124
  • 5
  • 61
  • 81
Yasser B.
  • 835
  • 6
  • 20
  • 34
  • Might be duplicate of :http://stackoverflow.com/questions/12409600/error-request-header-field-content-type-is-not-allowed-by-access-control-allow – Mox Shah May 18 '15 at 12:40
  • Try fixing the typo "applicaiton" to "application" and you can mention the content type this way, contentType: "application/json" – kvn May 18 '15 at 12:56

0 Answers0