企业🤖AI Agent构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
[[官方文档]](https://www.getpostman.com/) Postman allows you to publish documentation quickly and easily. Postman automatically pulls your sample requests, headers, code snippets, etc. to populate your documentation page with dynamic examples and machine-readable instructions so you can easily share your API with the rest of the world. ***** `PostMan`除了能很方便的测试后端接口,让后端童鞋们能略过前端直接检测接口的同时呢。 也能让前端童鞋们不用催着、等着后端童鞋们写接口了,我们可以通过`Mock`来本地模拟真实接口,返回固定数据。这样在数据结构确定之后,我们就可以直接开写代码咯,最后再切换成真实接口即可。 1. 创建接口集合(collection) 2. 在集合中添加一个接口(request) 3. 添加环境(envirement) 环境这个概念,可以通俗一点的理解成一个集合。我们把同一个项目中用到的一些重复的变量,比如说接口的域名`www.xxx.com`,我们就可以放在环境里面当成一个变量。正式环境与测试环境可以随时切换,而不用我们去每个接口都修改一下。 4. 创建`Mock Server` 创建一个虚拟服务来给我们写前端用。 5. 为虚拟服务地址建立环境变量 ## Plus [# 使用Postman的模拟服务模拟(mock)后端](https://blog.csdn.net/u013613428/article/details/82053793)