当前位置:网站首页>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 .
Method
Select the corresponding request methodRequest Path
Fill in the interface path information ,Request Body
Fill in the request body information ( You need to check this option in the setting on the right )Response Code
Fill in the response codeResponse Body
Fill 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
边栏推荐
- JSP learning 2
- vim编辑器的实时操作
- MySQL master-slave synchronization pit avoidance version tutorial
- DanceNN:字节自研千亿级规模文件元数据存储系统概述
- Detailed explanation of UWA pipeline function | visual configuration automatic test
- 力扣-746.使用最小花费爬楼梯
- 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
- 05 Lua control structure
- Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
- 计组 | 【七 输入/输出系统】知识点与例题
猜你喜欢
100 deep learning cases | day 41 - convolutional neural network (CNN): urbansound 8K audio classification (speech recognition)
Hypermotion cloud migration helped China Unicom. Qingyun completed the cloud project of a central enterprise and accelerated the cloud process of the group's core business system
Xinwangda: HEV and Bev super fast charging fist products are shipped on a large scale
Easyexcel reads the geographical location data in the excel table and sorts them according to Chinese pinyin
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
Zhongang Mining: Fluorite Flotation Process
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
Dlib of face recognition framework
第九天 static 抽象类 接口
Gartner 發布新興技術研究:深入洞悉元宇宙
随机推荐
建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
Introduction to how to set up LAN
浅谈 NFT项目的价值、破发、收割之争
Sail soft calls the method of dynamic parameter transfer and sets parameters in the title
Interview question 17.10 Main elements
【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案
PHP 零基础入门笔记(13):数组相关函数
Differences between MySQL BTREE index and hash index
七朋元视界可信元宇宙社交体系满足多元化的消费以及社交需求
vim编辑器的实时操作
Real time operation of vim editor
1959年高考数学真题
VIM uses vundle to install the code completion plug-in (youcompleteme)
The font of the soft cell changes color
Use case labeling mechanism of robot framework
Gartner publie une étude sur les nouvelles technologies: un aperçu du métacosme
Custom implementation of Baidu image recognition (instead of aipocr)
Deepinv20 installation MariaDB
基于GPU实例的Nanopore数据预处理