当前位置:网站首页>接口测试工具-Postman使用详解
接口测试工具-Postman使用详解
2022-07-27 08:42:00 【用户9925864】
前公司有个说法叫做狗粮环境,什么叫做狗粮环境,就是搭建环境自己测试自己的代码,算法很多时候写好后是通过restful接口对外使用,接口测试就要引出一个利器-Postman.
1、安装postman
官网下载地址:https://www.postman.com/downloads/
选择好对应的版本下载,下载完后直接安装即可。
2、postman界面说明
3、POSTMAN接口请求方法
GET请求:点击Params,输入参数及value,可输入多个,响应示例:显示请求的响应状态码,响应时间,以及响应文件大小
响应体示例:响应的格式可以有多种,我这里由于请求的是 百度,所以响应的是 html格式, 一般情况下,我们自定义接口的话是 json格式的响应体,对于常用的restful接口,基本都是返回json格式的报文
2. POST请求
POST请求一:表单提交下图示例中设置了请求方法,请求URL,请求参数,但是没有设置请求头。请求头是根据请求参数的形式自动生成的
请求头中的Content-Type与请求参数的格式之间是有关联关系,比如:
POST请求二:json提交 下图中,当我们选择JSON(application/json) 是会自动帮我们设置 headers 为 application/json
POST请求三:xml提交
POST请求四:二进制文件提交
其它请求方式如PUT,DELETE 大致流程和GET,POST 差不多,这里就不一一举例说明了
4、管理用例—Collections
Collections集合:也就是将多个接口请求可以放在一起,并管理起来,同一个工程建立一个Collection,这样方便查找及统一处理接口。
第一步, 创建Collections 点击上图中的带+号的图标,输入Name:”abc”,Description:”示例demo”,点击Create按钮即创建成功一个Collections. 第二步,在Collections里添加请求
在右侧准备好接口请求的所有数据,并验证后,点击save按钮。
保存好之后就可以在这里看到啦,之后要再次调用时可以点击这里,方便快捷
collections 管理精细化, 这里我们针对不同的请求方式做分组,添加子文件夹
边栏推荐
- Software test interview questions (key points)
- 说透缓存一致性与内存屏障
- 3311. Longest arithmetic
- UVM入门实验1
- Realize SPU management in the background
- The shelf life you filled in has been less than 10 days until now, and it is not allowed to publish. If the actual shelf life is more than 10 days, please truthfully fill in the production date and pu
- Function realization of order system
- Chapter 2 foreground data display
- 03.使用引号来监听对象嵌套值的变化
- Block, there is a gap between the block elements in the row
猜你喜欢

NIO this.selector.select()

openGauss之TryMe初体验

微信安装包从0.5M暴涨到260M,为什么我们的程序越来越大?

UVM Introduction Experiment 1

Have a good laugh

Explain cache consistency and memory barrier

Create a project to realize login and registration, generate JWT, and send verification code

Day3 -- flag state holding, exception handling and request hook

海量数据肖枫:共建共治openGauss根社区,共享欣欣向荣新生态

Eval and assert execute one sentence Trojan horse
随机推荐
NIO总结文——一篇读懂NIO整个流程
海量数据肖枫:共建共治openGauss根社区,共享欣欣向荣新生态
海关总署:这类产品暂停进口
Arm undefined instruction exception assembly
Realization of backstage brand management function
Implementation of adding function of background user management display
Arm system call exception assembly
帮忙发几个招聘,有兴趣可以看看
Hundreds of people participated. What are these people talking about in the opengauss open source community?
The following license SolidWorks Standard cannot be obtained, and the use license file cannot be found. (-1,359,2)。
说透缓存一致性与内存屏障
User management - restrictions
4277. 区块反转
P7 Day1 get to know the flask framework
Full Permutation (depth first, permutation tree)
Element display mode: block level, inline, inline block, nesting specification, display mode conversion
Using ecological power, opengauss breaks through the performance bottleneck
E. Split into two sets
3311. 最长算术
Flink1.15源码阅读flink-clients客户端执行流程(阅读较枯燥)