当前位置:网站首页>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
边栏推荐
- Nacos detailed explanation, something
- Pytorch: the pit between train mode and eval mode
- Summary according to classification in sail software
- 05 Lua control structure
- JSP learning 2
- G008-hwy-cc-estor-04 Huawei Dorado V6 storage simulator configuration
- Set cell filling and ranking method according to the size of the value in the soft report
- Force buckle-746 Climb stairs with minimum cost
- 各大框架都在使用的Unsafe类,到底有多神奇?
- 批量制造测试数据的思路,附源码
猜你喜欢

磁盘管理与文件系统

Cloud migration practice in the financial industry Ping An financial cloud integrates hypermotion cloud migration solution to provide migration services for customers in the financial industry

Sail soft implements a radio button, which can uniformly set the selection status of other radio buttons

DanceNN:字节自研千亿级规模文件元数据存储系统概述

299. Number guessing game

LVM and disk quota

Selenium IDE and XPath installation of chrome plug-in

Set the color change of interlaced lines in cells in the sail software and the font becomes larger and red when the number is greater than 100

Six scenarios of cloud migration

详解牛客----手套
随机推荐
05 Lua 控制结构
◰GL-着色器处理程序封装
JSP learning 2
Ali developed three sides, and the interviewer's set of combined punches made me confused on the spot
DDT + Excel for interface test
Knowledge points and examples of [seven input / output systems]
Flask如何在内存中缓存数据?
Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
1959年高考数学真题
Esxi encapsulated network card driver
NVIDIA显卡驱动报错
UWA Pipeline 功能详解|可视化配置自动测试
Detailed explanation of gzip and gunzip decompression parameters
Findstr is not an internal or external command workaround
How to build tiktok user trust and drive fan growth
关于 background-image 渐变gradient()那些事!
博士申请 | 厦门大学信息学院郭诗辉老师团队招收全奖博士/博后/实习生
Kunteng full duplex digital wireless transceiver chip kt1605 / kt1606 / kt1607 / kt1608 is suitable for interphone scheme
英语 | Day15、16 x 句句真研每日一句(从句断开、修饰)
Install MySQL on MAC