你说的 “debianpostman” 我理解应该是 在 Debian 系统上使用 Postman 来测试接口。下面分几种常见情况说明。
sudo apt update
sudo apt install snapd -y
sudo snap install postman
安装完成后:
postman
或在菜单中搜索 Postman
wget https://dl.pstmn.io/download/latest/linux64 -O postman.tar.gz
tar -xvf postman.tar.gz
sudo mv Postman /opt/
sudo ln -s /opt/Postman/Postman /usr/bin/postman
GETPOSTPUTDELETE示例:
http://localhost:8080/api/user
id = 1
{
"username": "admin",
"password": "123456"
}
常见:
Content-Type: application/json
Authorization: Bearer token
例如你有一个接口在 Debian 上:
http://127.0.0.1:5000/api/test
Postman 中直接填:
http://127.0.0.1:5000/api/test
⚠️ 注意:
如果你只是想快速测试接口,也可以不用 Postman:
curl http://localhost:8080/api/user
curl -X POST http://localhost:8080/login \
-H "Content-Type: application/json" \
-d '{"user":"admin","pass":"123"}'
sudo apt install libnss3 libgtk-3-0
0.0.0.0sudo ufw status
如果你能具体说一下:
我可以给你更针对性的测试示例。