Skip to content

Postman 配置

IDE 设置

在 IDE 中配置 Postman 设置:

Settings > Other Settings > EasyApi > Postman

设置项说明
TokenPostman API Token
WorkspacePostman 工作区 ID
Export Mode导出时如何处理集合(见下方)
Build Example是否在导出的集合中构建示例数据(默认:开启)
JSON5 Format TypeJSON5 格式的使用范围(见下方)
Collections模块与集合的映射(每行一个 module:collectionId

获取 Postman API Key

  1. 登录 Postman
  2. 进入 Account Settings > API Keys
  3. 生成新的 API Key

导出模式

模式说明
CREATE_NEW始终创建新集合(默认)
UPDATE_EXISTING尝试按模块更新已有集合

配置文件规则

以下规则可以在配置文件(.easy.api.config)中设置:

规则说明
postman.hostPostman 基础 URL
postman.prerequest预请求脚本
postman.test测试脚本
postman.class.prerequest类级别预请求脚本
postman.class.test类级别测试脚本
postman.collection.prerequest集合级别预请求事件
postman.collection.test集合级别测试事件
postman.format.after格式化后钩子

JSON5 格式类型

控制导出的 Postman 集合中 JSON5 格式的使用范围:

类型说明
NONE不使用 JSON5
REQUEST_ONLY仅请求体使用 JSON5
RESPONSE_ONLY仅响应体使用 JSON5
EXAMPLE_ONLY仅示例使用 JSON5(默认)
ALL始终使用 JSON5

基于 Apache-2.0 许可发布