当前位置:网站首页>Mock test using postman
Mock test using postman
2022-04-23 16:40:00 【Sink the wine cup and fleeting time】
Use Postman Conduct Mock test
Interface information
Interface path /mock/testdemo
Request header
Content-Type application/json
token 21232f297a57a5a743894a0e4a801fc3
Request body
{
"memberid": "264903145",
"phonenum": "17379797878",
"msg": {
"Country": " China ",
"Province": " Guangdong province, ",
"City": " guangzhou ",
"Isp": " telecom "
},
"type_code": 0
}
Response body
{
"code": "0000",
"msg": {
"result": "success",
"memberinfo": " Silver members ",
"membertype": "1"
}
}
Create a new one Mock service
1、 open Postman, Click on the top left corner New, choice Mock Server

2、 edit Mock Request information

Choose here Create a new API, Create a new one Mock Of API Interface .
MethodSelect the corresponding request methodRequest PathFill in the interface path information ,Request BodyFill in the request body information ( You need to check this option in the setting on the right )Response CodeFill in the response codeResponse BodyFill in the response body information
3、 To configure Mock Service information

Fill in Mock Name of service ( Available in Chinese ), Check Make this Mock server private( Unchecked ), This Mock Services can only be accessed privately by yourself

The yellow part is Mock Server address
If you need to do this Mock Service creation API key, You can click on the here Open a browser page , Need to generate a API key,

name API key

Generate secret key information

When accessing this interface later , You must bring... In the request header API key, In order to visit successfully , It is equivalent to the role of an interface authentication
4、Mock Service creation succeeded

You can also meet this need Mock The interface of , Edit the definition again , Click on Examples, To define template rules

The request header specifies Content-Type The type of , add cookie / token Information , Specify the response returned json Information

visit Mock service
have access to postman 、jmeter And other interface testing tools , It is still used here postman
In the address bar Mock The server address and interface path are spliced into URL, Fill in the corresponding parameters , Send a request

You can find the content of the interface response , It's defined Examples The content in
版权声明
本文为[Sink the wine cup and fleeting time]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231402128189.html
边栏推荐
- 【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......
- Selenium IDE and XPath installation of chrome plug-in
- Gartner 发布新兴技术研究:深入洞悉元宇宙
- LVM与磁盘配额
- Pytorch: the pit between train mode and eval mode
- 众昂矿业:萤石浮选工艺
- Gartner publie une étude sur les nouvelles technologies: un aperçu du métacosme
- Interview question 17.10 Main elements
- 5分钟NLP:Text-To-Text Transfer Transformer (T5)统一的文本到文本任务模型
- Deepinv20 installation MariaDB
猜你喜欢

299. Number guessing game

100 deep learning cases | day 41 - convolutional neural network (CNN): urbansound 8K audio classification (speech recognition)

批量制造测试数据的思路,附源码

How magical is the unsafe class used by all major frameworks?

力扣-198.打家劫舍

Use if else to judge in sail software - use the title condition to judge

RecyclerView advanced use - to realize drag and drop function of imitation Alipay menu edit page

Sail soft calls the method of dynamic parameter transfer and sets parameters in the title

漫画:什么是IaaS、PaaS、SaaS?

Deepinv20 installation MariaDB
随机推荐
文件操作详解(2)
Easyexcel reads the geographical location data in the excel table and sorts them according to Chinese pinyin
Real time operation of vim editor
欣旺达:HEV和BEV超快充拳头产品大规模出货
English | day15, 16 x sentence true research daily sentence (clause disconnection, modification)
How to quickly batch create text documents?
ByteVCharts可视化图表库,你想要的我都有
JMeter installation tutorial and solutions to the problems I encountered
MySQL personal learning summary
MySQL的btree索引和hash索引区别
阿里研发三面,面试官一套组合拳让我当场懵逼
批量制造测试数据的思路,附源码
七朋元视界可信元宇宙社交体系满足多元化的消费以及社交需求
【PIMF】OpenHarmony啃论文俱乐部—在ACM Survey闲逛是什么体验
【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......
How to conduct application security test (AST)
Custom implementation of Baidu image recognition (instead of aipocr)
文件系统读写性能测试实战
Esxi encapsulated network card driver
The solution of not displaying a whole line when the total value needs to be set to 0 in sail software