Skip to content

Instantly share code, notes, and snippets.

@karimmtarek
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save karimmtarek/1e56e6d288d66a548db3 to your computer and use it in GitHub Desktop.

Select an option

Save karimmtarek/1e56e6d288d66a548db3 to your computer and use it in GitHub Desktop.
todowiz curl syntax
### Get lists
curl -X GET http://todowiz:3000/v1/lists -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"'
### Update lists
curl -X PUT http://todowiz:3000/v1/lists/5 -H 'Authorization: Token token="13da9ded671555ef5aaa"' -d "list[permission]=private"
### get header information
curl -X GET http://todowiz:3000/v1/lists -I
### Create new user
curl -d "user[email][email protected]" -d "user[password]=password" http://todowiz:3000/v1/users
### Create a user
curl -X DELETE http://todowiz:3000/v1/users/1
### Create new list
curl -d "list[name]=my list name" -d "list[permission]=public" http://todowiz:3000/v1/lists -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"'
### Create new item
curl -d "item[name]=my todo item name" http://todowiz:3000/v1/lists/19/items -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"'
### update item
curl -X PUT http://todowiz:3000/v1/lists/19/items/11 -H 'Authorization: Token token="c7fb3b4e268c1dfaa91c"' -d "item[name]=my todo item name" -d "item[completed]=true"
### login to devise in rails console
app.post '/v1/users/sign_in', user: {email: '[email protected]', password: "password"}
app.post '/v1/users', user: {email: '[email protected]', password: "password", password_confirmation: "password"}
### access using basic access_token
curl 'http://todowiz:3000/v1/lists?access_token=672deada2bf9b37476dd09af2623633d'
curl http://todowiz:3000/v1/lists -H 'Authorization: Token token="7e24748db562367c7788"'
app.get '/v1/lists', -H 'Authorization: Token token="7e24748db562367c7788"'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment