CSRF Failed: CSRF token missing or incorrect

前端 未结 12 914
臣服心动
臣服心动 2020-11-29 02:42

I\'m using Django 1.7 and django-rest-framework.

I made an API that returns me some JSON data putting this in my settings.py

REST_FRAMEW         


        
12条回答
  •  [愿得一人]
    2020-11-29 03:18

    1- Search for the Cookie header

    2- Separate the csrftoken from the sessionid

    3- Add the X-CSRFToken={..the csrftoken that you extracted in step 2..} see below

    4- Post again

提交回复
热议问题