使用git curl服务测试-----Restful服务

来源:互联网 发布:联想售后系统优化 编辑:程序博客网 时间:2024/06/05 17:52
使用git curl服务测试-----Restful服务


1、post【添加一个对象】
curl -l -H "Content-type: application/json" -X POST -d '{"name":"aaaa","state":"bbbb","country":"cccc","map":"ddd"}' http://localhost:8080/city2


2、get【获取一个对象】
curl.exe http://localhost:8080/city/xxx
 ---------------xxx为对象ID
3、get【获取分页】
curl.exe http://localhost:8080/city2?page=10
---------------page页面

4、delete【删除一个对象】
curl -X DELETE http://localhost:8080/city2?id=xxx
---------------xxx为对象ID

5、put【修改一个对象】
curl -H "Content-Type:application/json"  -X PUT -i -d '{"name":"aaaa","state":"bbbb","country":"cccc","map":"ddd"}'  http://localhost:8080/city2?id=xxx
---------------xxx为对象ID



0 0
原创粉丝点击