当前位置:网站首页>request对象对请求体,请求头参数的解析
request对象对请求体,请求头参数的解析
2022-07-07 07:17:00 【chuntian_tester】
1.请求体参数解析:
1.1 GET请求
1.1.1 请求url中/?xxx&xxx格式为查询字符串参数,通过request.GET获取请求参数
1.1.2 请求url中/xxx/2/xxx格式为路径参数,通过request.GET获取
1.1.3 url中xx/?name=aa&age=19&name=bb,通过request.GET获取,若想获取所有name参数,通过getlist('key1')获取相同key的多个值,返回list类型
1.2 POS请求
1.2.1 json格式请求体参数
json格式的参数会存放在body中,一般为bytes字节类型,使用json.loads(request.body)处理后提取参数
1.2.2 www-form-urlencoded格式参数
一般在前端通过表单录入的参数就是www-form-urlencoded类型 ,通过request.POST获取
1.2.3 file文件类型参数
1.2.3.1 通过form-data中的file类型参数
content_type类型为multipart/form-data,参数从request.body中获取
1.2.3.2 通过binary中的file类型参数
纯文件,都用request.body获取
2.请求头参数解析:
2.1 request.headers['key']或者request.headers.get('key')获取
2.2 request.META['HTTP_AUTHORIZATION']获取
请求头参数会被转化为:HTTP_参数名大写,如果参数名中有‘-’符号,会自动转化为‘_'
边栏推荐
- JS逆向教程第一发
- 2020 Zhejiang Provincial Games
- [4g/5g/6g topic foundation-146]: Interpretation of white paper on 6G overall vision and potential key technologies-1-overall vision
- [Frida practice] "one line" code teaches you to obtain all Lua scripts in wegame platform
- CDZSC_ 2022 winter vacation personal training match level 21 (2)
- C socke server, client, UDP
- Applet sliding, clicking and switching simple UI
- 小程序弹出半角遮罩层
- [bw16 application] Anxin can realize mqtt communication with bw16 module / development board at instruction
- Niuke - Huawei question bank (61~70)
猜你喜欢
字节跳动 Kitex 在森马电商场景的落地实践
Diffusion模型详解
Internship log - day07
Impression notes finally support the default markdown preview mode
How does mongodb realize the creation and deletion of databases, the creation of deletion tables, and the addition, deletion, modification and query of data
The applet realizes multi-level page switching back and forth, and supports sliding and clicking operations
Applet sliding, clicking and switching simple UI
【frida实战】“一行”代码教你获取WeGame平台中所有的lua脚本
[4g/5g/6g topic foundation-146]: Interpretation of white paper on 6G overall vision and potential key technologies-1-overall vision
CentOS installs JDK1.8 and mysql5 and 8 (the same command 58 in the second installation mode is common, opening access rights and changing passwords)
随机推荐
uboot机构简介
中国首款电音音频类“山野电音”数藏发售来了!
The combination of over clause and aggregate function in SQL Server
CSDN salary increase technology - learn about the use of several common logic controllers of JMeter
哈夫曼编码压缩文件
2016 CCPC Hangzhou Onsite
How to use Mongo shake to realize bidirectional synchronization of mongodb in shake database?
How to become a senior digital IC Design Engineer (1-6) Verilog coding Grammar: Classic Digital IC Design
20排位赛3
如何成为一名高级数字 IC 设计工程师(1-6)Verilog 编码语法篇:经典数字 IC 设计
使用BigDecimal的坑
Codeforces - 1324d pair of topics
Performance optimization record of the company's product "yunzhujia"
官媒关注!国内数字藏品平台百强榜发布,行业加速合规健康发展
终于可以一行代码也不用改了!ShardingSphere 原生驱动问世
La différence entre viewpager 2 et viewpager et la mise en œuvre de la rotation viewpager 2
剑指 Offer II 107. 矩阵中的距离
2020浙江省赛
企业实战|复杂业务关系下的银行业运维指标体系建设
js逆向教程第二发-猿人学第一题