接口测试时保存Forbidden (CSRF cookie not set.)

对使用django框架开发的web网页作接口测试时,使用POST方法请求数据时
出现报错: Forbidden (CSRF cookie not set.): ****

我的:(Forbidden (CSRF cookie not set.): /apis/ [30/Nov/2019 22:54:18] “POST /apis/ HTTP/1.1” 403 2837)

解决办法:项目文件中的setting.py中将csrf语句注释掉

在这里插入图片描述

发布了61 篇原创文章 · 获赞 21 · 访问量 9120

猜你喜欢

转载自blog.csdn.net/xbean1028/article/details/103330575