Skip to content

Instantly share code, notes, and snippets.

@vigosan
Forked from fanktom/gist:1675562
Last active August 29, 2015 13:57
Show Gist options
  • Save vigosan/9357298 to your computer and use it in GitHub Desktop.
Save vigosan/9357298 to your computer and use it in GitHub Desktop.
# list
curl -v http://localhost:9292/api/v1/posts
# create
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"login":"foo","password":"bar"}' http://localhost:9292/api/v1/login
# read
curl -v http://localhost:9292/api/v1/posts/1.json
# update
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"post":{"title":"new"}}' http://localhost:9292/api/v1/posts/1.json
# delete
curl -v http://localhost:9292/api/v1/posts/1.json -X DELETE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment