CORS error with jquery

后端 未结 4 1153
后悔当初
后悔当初 2020-12-01 21:58

I\'m currently working on a project using the cloudapp API and I\'m using jquery. Here is my code:

 $.ajax({
            headers: { \"Accept\": \"application         


        
4条回答
  •  一个人的身影
    2020-12-01 22:44

    to fix the error, you need to enable CORS on the server. The client expects to see CORS headers sent back in order to allow the request. It might even send a preflight request to make sure that the headers are there.

    You can enable CORS server side for one, multiple, or all domains hitting your server. The configuration is different depending on the type of your server.

    Refer to the following page for more info : http://enable-cors.org/server.html

    You already enabled CORS requests in your request above, so client side you should be all set.

提交回复
热议问题