RESTing with CURL

Pretty nice tutorial to make REST WEB service calls using curl

http://blogs.plexibus.com/2009/01/15/rest-esting-with-curl/

Get
curl -i -H “Accept: application/json” http://192.168.0.165/persons/person/1

curl -i -H “Accept: application/json” “http://192.168.0.165/persons?firstName=james&lastName=wallis”

Delete
curl -i -H “Accept: application/json” -X DELETE http://192.168.0.165/persons/person/1

POST DATA TO REST RESOURCE
curl -i -H “Accept: application/json” -X POST -d “firstName=james” http://192.168.0.165/persons/person

PUT A RESPONSE
curl -i -H “Accept: application/json” -X PUT -d “phone=1-800-999-9999″ http://192.168.0.165/persons/person/1

POST TO PUT
curl -i -H “Accept: application/json” -H “X-HTTP-Method-Override: PUT” -X POST -d “phone=1-800-999-9999″ http://192.168.0.165/persons/person/1
POST TO DELETE
curl -i -H “Accept: application/json” -H “X-HTTP-Method-Override: DELETE” -X POST http://192.168.0.3:8090/persons/person/1

…..

Advertisement
Explore posts in the same categories: Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s


Follow

Get every new post delivered to your Inbox.