一、get请求
curl 加地址
curl http://192.168.1.2:8080/server/test/query?id=1
二、post请求
1)无参请求
curl -d "" http://192.168.1.2:8080/server/test/deleteAll
2)带有参数
①参数使用&拼接:
curl -d "id=1&name=user" http://192.168.1.2:8080/server/test/deleteById
②参数直接放在Header里:
curl -H "Content-Type:application/json" -X POST -d '{"id": "1", "name":"user"}' http://192.168.1.2:8080/server/test/deleteByIds
来源:CSDN
作者:徒手千行代码无bug
链接:https://blog.csdn.net/Kevin___________/article/details/104653547