Method | URL | Action |
GET | /api/wines | Retrieve all wines |
GET | /api/wines/search/Chateau | Search for wines with ‘Chateau’ in their name |
GET | /api/wines/10 | Retrieve wine with id == 10 |
POST | /api/wines | Add a new wine |
PUT | /api/wines/10 | Update wine with id == 10 |
DELETE | /api/wines/10 | Delete wine with id == 10 |
curl -i -X GET http://localhost:8080/cellar/rest/wines |
curl -i -X GET http://localhost:8080/cellar/rest/wines -H 'Accept:application/xml' |
curl -i -X GET http://localhost:8080/cellar/rest/wines/search/chateau |
curl -i -X GET http://localhost:8080/cellar/rest/wines/5 |
curl -i -X DELETE http://localhost:8080/cellar/rest/wines/5 |
curl -i -X POST -H 'Content-Type: application/json' -d '{"name": "New Wine", "year": "2009"}' http://localhost:8080/cellar/rest/wines |
curl -i -X PUT -H 'Content-Type: application/json' -d '{"id": "27", "name": "New Wine", "year": "2010"}' http://localhost:8080/cellar/rest/wines/27 |
欢迎光临 创星网络[分享知识 传递快乐] (http://bbs.cxweb.com.cn/) | Powered by Discuz! X3 |