Sunday, 23 May 2010

PWS HW4. - Client Curl

Once everything is running, you can use Curl as the client to test the service. For Linux and Mac user, it comes with the operation system. For Windows user, you can download it here:

1. GET commands
1.1 Get XML file (Default)
curl http://localhost:8080/Jersey/rest contacts

1.2 Get Json file
curl -HAccept:application/json http://localhost:8080/Jersey/rest/contacts

2. PUT command
curl -X PUT -HContent-type:application/xml --data "foobar" http://localhost:8080/Jersey/rest/contacts/foo

3. DELETE command
curl -X DELETE http://localhost:8080/Jersey/rest/contacts/foo

No comments:

Post a Comment