Postman 设置 Token

原创转载请注明出处:https://www.cnblogs.com/agilestyle/p/15214653.html

系统项目在对接调试的过程中,往往会遇到某些应用服务接口,需要携带授权服务接口生成的 token,方可进行调用。

通常可以配置 Postman 的 断言来提高对接调试效率。

Postman 断言

pm.test("Resp status is 200", function () {
    pm.response.to.have.status(200);
});

pm.test("Return an access_token", function () {
    var jsonData = pm.response.json();
    pm.expect(jsonData.access_token).not.eq(null);

    pm.environment.set("oauth_token", jsonData.access_token);
});

某 Token 服务接口

某 应用服务 接口


欢迎点赞关注和收藏

强者自救 圣者渡人
原文地址:https://www.cnblogs.com/agilestyle/p/15214653.html