一些 postman

听了:https://v.qq.com/x/page/f0816egftuw.html

npm 是 node package manager, Nodejs下的包管理器。安装完 nodejs 后(node-v10.16.0-x64.msi),就同时安装了。
postman 可以用 newman 从命令行 trigger  Postman 的 json 脚本。
而 newman 的安装可以采用 npm install -g newman 来完成。

这里有两个 api 站点,可以用来练习 postman 用:

https://www.v2ex.com/p/7v9tec53
https://www.v2ex.com/api/topics/hot.json

还有这个 kuaidi100 网站,提供 type 和 postid ,就可以提交 get 情况,练习 postman. 比如:

http://www.kuaidi100.com/query?type=tiantian&postid=669472972063

tests["http响应码需要时200"] = responseCode.code === 200;

var res = JSON.parse(responseBody);
console.log(res.length);
tests["需要返回首页十条数据"] = res.length === 10;


pm.test("返回正确的状态码", function()
{
    pm.expect(pm.response).to.have.status(200);
});

 postman 的 api 站点:

https://www.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference
 
原文地址:https://www.cnblogs.com/backpacker/p/11184153.html