在 Ubuntu 下使用 Postman 调试接口,一般可以按下面步骤来(适用于桌面版 Postman 或命令行 Newman)。
tar -xzf Postman-linux-x64-*.tar.gz
./Postman/Postman
sudo snap install postman
GETPOSTPUTDELETE例如:
http://localhost:8080/api/user
Content-Type: application/json
Authorization: Bearer token
{
"name": "test"
}
打开方式:
View → Show Postman Console
或快捷键:
Ctrl + Alt + C
可以看到:
✅ 用:
http://127.0.0.1:端口
而不是 localhost
Postman 设置:
Settings → General → SSL certificate verification → OFF
如果 Ubuntu 使用了系统代理:
Settings → Proxy
可关闭 Use System Proxy
确保接口服务已启动,并且端口未被防火墙阻止:
curl http://localhost:8080
如果你用 Postman 导出了 Collection:
npm install -g newman
newman run example.postman_collection.json
✅ 先用 curl 验证接口是否通
✅ 再用 Postman 构造复杂请求
✅ 善用 Postman Console
✅ 本地服务优先用 127.0.0.1
如果你愿意,可以告诉我:
我可以给你更针对性的调试方案。