python3 web接口调用——Forbidden (CSRF cookie not set.): xxx
来源:互联网 发布:日本it行业知乎 编辑:程序博客网 时间:2024/06/05 05:37
1.问题:一般注意会报csrf错误(csrf自己了解)
页面访问时报错
Forbidden (CSRF cookie not set.): xxx
解决方法:
修改settings.py文件,注释掉
django.middleware.csrf.CsrfViewMiddleware',
2.python3调用过程:(需要加入requests三方,pip3 install requests)
import requests
url = "http://127.0.0.1:8000/api/add_event/"
payload = {'eid':3,'name':'小米6','limit':2000,
'address':"北京水立方",'start_time':'2017-05-10 12:00:00'}
r = requests.post(url,data = payload)
result = r.json()
print(result)
阅读全文
0 0
- python3 web接口调用——Forbidden (CSRF cookie not set.): xxx
- Django app接口url报错Forbidden (CSRF cookie not set.)
- 关于python 的django-forbidden-csrf-cookie-not-set问题
- python django-forbidden-csrf-cookie-not-set问题
- Django 用postman进行post请求时:Forbidden (CSRF cookie not set.) 403
- django错误 - Reason given for failure: CSRF cookie not set.
- django错误 - Reason given for failure: CSRF cookie not set.
- django+Python的项目中出现 "detail": "CSRF Failed: CSRF cookie not set."
- Django csrf cooie is not set
- web安全基础——CSRF
- web安全————CSRF(攻击篇)
- web安全————CSRF(防御篇)
- web安全——CSRF漏洞原理和解决方案
- 黑马程序员—Set接口
- 【HTTP Cookie响应头】 Set-Cookie XXX= xxx(为空清除); domain= xxx; expires= xxx; path= xxx
- 测试调用XXX.asmx类型接口
- golang web cookie 封装调用
- Web Service 接口调用
- 成员函数的重载、覆盖和隐藏
- OpenGL 基础2
- DTO,BO, PO之间的转换可以用这个框架;java 对象转换
- Spark 中算子功能与分类介绍
- cookie和session区别
- python3 web接口调用——Forbidden (CSRF cookie not set.): xxx
- 常用分类聚类算法
- IDEA破解 2017 IDEA license server 激活(可用)
- Arima模型注意事项(Duke university)
- 初学js(1)
- MongoDB 文档的查询和插入操作
- linux——防火墙
- 机器学习之逻辑回归 Logistic Regression(三)scikit-learn算法库
- HTML基础(9.2 表格)