当前位置:网站首页>Interface test practice | Detailed explanation of the difference between GET / POST requests
Interface test practice | Detailed explanation of the difference between GET / POST requests
2022-08-03 04:32:00 【Yehenara Hermione】
1. The method of the request line is different;
2. POST can attach body, and can support various data formats such as form, json, xml, binary, etc.;
3. From the perspective of general industry specifications,GET request is recommended for no state change, and POST request is recommended for data writing and status;
In order to avoid the interference of other factors, use Flask to write a simple Demo Server.
4. Install flask
5. Create a hello.py file
hello.py
6. Start the service
If the following information is prompted, the build is successful.
Initiate a GET request, send the a and b parameters into the URL, and save them in the get file:
Initiate a POST request, send the a and b parameters in form-data format, and save them in the post file:
Note: The right side of the > is the request content, and the left side of the < is the response content.
GET request process
POST request process
Compare the two files:
It can be clearly seen from the figure that the method of the GET request is GET, and the method of the POST request is POST. In addition, the GET request does not have the fields Content-Type and Content-Length, and the URL in the request line contains queryparameter, which is a format allowed for both requests.(End)
Recommend Hogwarts' "Test Development from Beginner to Advanced Combat System Advancement" course, which is close to the first-line practice content of major manufacturers and leads the industry.
5 months from the shallow to the deep, intensive training, led by the test master Sihan, teaching them how to fish, and through 10+ enterprise-level project actual combat drills, it will take you to master the necessary core skills of BAT test development engineers in one stop (Benchmark Alibaba P6+, challenge annual salary of 50W+)!Students directly push the test managers of famous BAT companies, and the salary is generally increased by 50%+!
Improve your core competitiveness
边栏推荐
猜你喜欢
随机推荐
肖sir__简历
t conditional judgment statement and if loop
SM30 表维护视图数据保存前 数据校验事件
表的创建、修改与删除
直播|StarRocks 技术内幕 :低基数全局字典优化
工程水文学试题库
【生物素叠氮化物|cas:908007-17-0】价格_厂家
JS底层手写
中断系统需要解决的问题
MediaRecorder录制屏幕时在部分机型上报错prepare failed:-22
DDL操作数据库、表、列
2.何为张量
数值类型转换02
深圳线下报名|StarRocks on AWS:如何对实时数仓进行极速统一分析
11.机器学习基础:机器学习的四个分支
DFS对剪枝的补充
索引创建、删除与使用
汇编题答案
【软件工程之美 - 专栏笔记】35 | 版本发布:软件上线只是新的开始
超好用的画图工具推荐