How to make a POST simple JSON using Django REST Framework? CSRF token missing or incorrect

前端 未结 8 2138
清酒与你
清酒与你 2020-12-04 15:50

Would appreciate someone showing me how to make a simple POST request using JSON with Django REST framework. I do not see any examples of this in the tutorial anywhere?

8条回答
  •  鱼传尺愫
    2020-12-04 16:14

    CSRF is exempted by default in Django REST Framework. Therefore, curl POST request works fine. POSTMAN request call returned CSRF incorrect because POSTMAN included csrf token if it is found in Cookies. You can solve this by cleaning up Cookies.

提交回复
热议问题