一些 postman

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

 

 

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

这里有两个 api 站点,能够用来练习 postman 用:
node

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

还有这个 kuaidi100 网站,提供 type 和 postid ,就能够提交 get 状况,练习 postman. 好比:
json

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);
});api

 

 postman 的 api 站点:
post

 

https://www.getpostman.com/docs/postman/scripts/postman_sandbox_api_reference
 
相关文章
相关标签/搜索