'Request header field Authorization is not allowed' error - Tastypie

前端 未结 5 1169
感情败类
感情败类 2020-12-30 22:31

I am getting the following error while using ApiKeyAuthentication for my Tastypie resources when I try to do an HTTP request using AJAX and Tastypie:

XMLHttp         


        
5条回答
  •  南方客
    南方客 (楼主)
    2020-12-30 23:16

    This happens because of Same origin policy.

    You need to make AJAX call from same domain where request goes. Or make server-side changes, allowing requests from external domains.

    To resolve this you need to make changes in headers at http://domain.com by allowing your external domain in headers:

    Access-Control-Allow-Origin: *
    

    Read more

提交回复
热议问题