在 Linux 下使用 Postman 主要有 两种方式:
下面从 安装 → 基本使用 → 常见场景 一步步说明。
# 1. 下载
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
# 2. 解压
tar -xzf postman.tar.gz -C /opt
# 3. 创建快捷方式
sudo ln -s /opt/Postman/Postman /usr/bin/postman
启动:
postman
或直接在文件管理器中打开 /opt/Postman/Postman
sudo snap install postman
flatpak install flathub com.getpostman.Postman
GET / POST / PUT / DELETEhttp://localhost:8080/api/users
Content-Type: application/json
Authorization: Bearer xxx
{
"username": "test",
"password": "123456"
}
dev
base_url = http://localhost:8080{{base_url}}/api/users
切换环境即可测试不同服务器。
sudo npm install -g newman
newman run collection.json
newman run collection.json -e env.json
常用于:
sudo apt install libgconf-2-4
Accept: application/json; charset=utf-8
如果你愿意,可以告诉我:
我可以直接给你一套 适合你场景的操作流程。