jQuery Ajax - POST from Localhost Generates No 'Access-Control-Allow-Origin' header
I thought I understood CORS, but there is something I do not understand apparently. I have an app that I am trying to run from localhost. This app needs to POST a request to Azure Search. I am trying to upload a search document. In an attempt to do this, I have the following: var url = 'https://my-app.search.windows.net/indexes/test/docs/index?api-version=2015-02-28'; $.ajax({ url: url, type: 'POST', contentType:'application/json', headers: { 'api-key':'XXXXXX', 'Content-Type':'application/json' }, beforeSend: function (req) { req.setRequestHeader('Access-Control-Allow-Origin', '*'); }, data: