19 request请求数据大全
2024-09-08 19:09:31
1 request.path_info
# 获取当前用户请求的url
# http://127.0.0.1:8000/customer/list/ ----> /customer/list/
# http://127.0.0.1:8000/customer/list/?age=19 ----> /customer/list/
print(request.path_info)
2 request.method
# 获取当前用户请求方式:(GET/POST)
print(request.method)
3 request.POST
# 获取当前用户POST请求数据
print(request.POST)
# <QueryDict: {'csrfmiddlewaretoken': ['jdoNHfaNRIBlLCM8QXbLJld8XP4UYehyh8ykrW4erOuB83aaFH3YNJQlnGzm7qo9'], 'username': ['123'], 'password': ['123']}>
# 获取单个数据
request.POST.get('xx')
# 获取多个数据
request.POST.getlist('xx')
4 request.FILES
文件
最新文章
- 查询EBS中LOV的SQL语句
- [Android]实现类似微信的延迟加载的Fragment——LazyFragment
- Javascript数组方法(译)
- Linux如何删除以分号开头的文件
- wireshark抓包
- cocos2d-x 纹理研究
- js 注册手机摇动事件
- C#多线程,线程锁
- 【bzoj 3601】一个人的数论 (莫比乌斯反演+伯努利数)
- ArcGIS API For Javascript_4.8-渲染器Renderer
- [Alpha阶段]项目展示博客
- Mongodb到mysql数据库的数据迁移(Java,Windows)
- TP文件上传
- 遗忘Windows Server 2008R2密码的处理方法
- html样式表格
- JS 解析JSON实现导序
- [ZOJ3781]Paint the Grid Reloaded
- windows 10 WMI Provider Host 占用CPU过高的问题
- Authentication failed (rejected by the remote node), please check the Erlang
- tty linux 打开和设置范例