Skip to content

Instantly share code, notes, and snippets.

@fanktom
Created January 25, 2012 09:11
Show Gist options
  • Save fanktom/1675562 to your computer and use it in GitHub Desktop.
Save fanktom/1675562 to your computer and use it in GitHub Desktop.
Rails 3 CRUD Curls
# list
curl -v http://localhost:3000/organizations.json
# create
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"organization":{"first_name":"firstname","last_name":"lastname","email":"email@email.com"}}' http://localhost:3000/organizations
# read
url -v http://localhost:3000/organizations/1.json
# update
curl -v -H "Accept: application/json" -H "Content-type: application/json" -X PUT -d '{"organization":{"first_name":"firstname","last_name":"lastname","email":"email@email.com"}}' http://localhost:3000/organizations/1.json
# delete
curl -v http://localhost:3000/organizations/1.json -X DELETE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment