在Ubuntu上创建Postman新请求
一 准备工作
sudo snap install postman --classicsudo dpkg -i /path/to/postman.deb,如有依赖问题运行:sudo apt-get install -fwget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz,然后 sudo tar -xzf postman.tar.gz -C /opt,可创建软链:sudo ln -s /opt/Postman/Postman /usr/local/bin/postman二 创建新请求的步骤
三 常用设置与管理
pm.test("Status code is 200", () => pm.response.to.have.status(200));
pm.test("Response has userId", () => {
const json = pm.response.json();
pm.expect(json).to.have.property('userId');
});