在 Linux 下使用 Postman,通常有两种方式:桌面客户端 和 命令行工具(Newman)。下面分别说明配置方法。
# 下载
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
# 解压
tar -xzf postman.tar.gz -C /opt
# 创建软链接
ln -s /opt/Postman/Postman /usr/local/bin/postman
启动:
postman
sudo snap install postman
yay -S postman-bin
Settings → Proxy
Add a custom proxy configuration127.0.0.17890(Clash / 公司代理)Settings → Certificates
base_url = http://localhost:8080
token = xxxx
{{base_url}}/api/user
pm.globals.set("token", "abc123");
npm install -g newman
newman run example.postman_collection.json \
-e env.postman_environment.json
newman run collection.json \
-e env.json \
--delay-request 500 \
--reporters cli,html \
--reporter-html-export report.html
sudo apt install libnss3 libgtk-3-0 libgbm1
Content-Type: application/json; charset=utf-8
localhost / 127.0.0.1如果你有 具体使用场景(如:公司代理、Docker 内服务、自动化测试),可以告诉我,我可以给你更针对性的配置示例。