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

前端 未结 5 1183
感情败类
感情败类 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:21

    Antyrat's answer is not complete.

    You have to specify which headers your server allows; in your case Authorization.

    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET, POST, PUT, DELETE
    Access-Control-Allow-Headers: Authorization
    

提交回复
热议问题