git clone https://github.com/johnidm/java-seed-webservice
Open project in your preference IDE and run project.
Based in URL http://localhost:8080
and URI http://localhost:8080/api/v1
###XML
#####GET
curl -v -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://localhost:8080/api/v1/bier
#####GET (specify item)
curl -v -H "Accept: application/xml" -H "Content-Type: application/xml" -X GET http://localhost:8080/api/v1/bier/2
#####DELETE
curl -v -H "Accept: application/xml" -H "Content-Type: application/xml" -X DELETE http://localhost:8080/api/v1/bier/3
#####POST
curl -v -H "Accept: application/xml" -H "Content-Type: application/xml" -X POST http://localhost:8080/api/v1/bier -d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bier><brewery>Way Beer</brewery><id>4</id><name>Way Beer Cream Porter</name><type>ALE</type></bier>'
#####PUT
curl -v -H "Accept: application/xml" -H "Content-Type: application/xml" -X PUT http://localhost:8080/api/v1/bier/3 -d '<?xml version="1.0" encoding="UTF-8" standalone="yes"?><bier><brewery>Hi-Wire Brewing</brewery><id>3</id><name>Hi-Wire Lager</name><type>ALE</type></bier>'
###JSON
#####GET
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8080/api/v1/bier
#####GET (specify item)
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X GET http://localhost:8080/api/v1/bier/2
#####DELETE
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X DELETE http://localhost:8080/api/v1/bier/3
#####POST
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X POST http://localhost:8080/api/v1/bier/ -d '{ "brewery": "Way Beer", "id": "4", "name": "Way Beer Cream Porter", "type": "ALE" }'
#####PUT
curl -v -H "Accept: application/json" -H "Content-Type: application/json" -X PUT http://localhost:8080/api/v1/bier/3 -d '{"brewery":"Hi-Wire Brewing","id":"3","name":"Hi-Wire Lager","type":"ALE"}'