Files
RestKit/Examples/RKDiscussionBoardExample/discussion_board_backend/demo app request:responses.txt

40 lines
2.6 KiB
Plaintext

curl -d "user[username]=jeremy&user[password]=password&user[email]=jeremy@twotoasters.com&user[password_confirmation]=password" http://localhost:3000/signup
=> {"single_access_token":"LvQmmzh6je1XzhC9XASg","login":"jeremy"}
curl -d "user[username]=jeremy&user[password]=password&user[email]=jeremy@twotoasters.com&user[password_confirmation]=password" http://discussionboard.heroku.com/signup
=> {"single_access_token":"onzn83RGNV93AQWPIY7W","login":"jeremy"}
curl -d "login=jeremy&password=password" http://localhost:3000/login
{"single_access_token":"LvQmmzh6je1XzhC9XASg","user_id":1,"login":"jeremy"}
curl -d "login=jeremy&password=password" http://discussionboard.heroku.com/login
{"single_access_token":"onzn83RGNV93AQWPIY7W","user_id":1,"login":"jeremy"}
set the SingleAccessToken header to the token (LvQmmzh6je1XzhC9XASg)
curl http://localhost:3000/topics
match 'login' => 'users#login'
match 'signup' => 'users#signup'
curl -d "topic[name]=NewTopic" -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics
{"topic":{"name":"NewTopic","created_at":"2011-01-07T17:18:10Z","updated_at":"2011-01-07T17:18:10Z","id":5,"user_id":1}}
curl -X PUT -d "topic[name]=UpdatedTopic" -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics/5
{"topic":{"name":"UpdatedTopic","created_at":"2011-01-07T17:18:10Z","updated_at":"2011-01-07T17:25:51Z","id":5,"user_id":1}}
curl -X DELETE -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics/5
{}
curl http://localhost:3000/topics/1/posts
curl -F "post[attachment]=@/usr/share/httpd/icons/world2.png" -F "post[body]=post_body" -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics/1/posts
{"post":{"attachment_file_name":"world2.png","attachment_content_type":"application/octet-stream","attachment_file_size":363,"created_at":"2011-01-07T17:51:44Z","body":"post_body","updated_at":"2011-01-07T17:51:44Z","id":2,"user_id":1,"topic_id":1,"attachment_updated_at":"2011-01-07T17:51:44Z"}}
curl -X PUT -F "post[attachment]=@/usr/share/httpd/icons/world1.png" -F "post[body]=post_body_update" -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics/1/posts/1
{"post":{"attachment_file_name":"world1.png","attachment_content_type":"application/octet-stream","attachment_file_size":332,"created_at":"2011-01-07T17:46:56Z","body":"post_body_update","updated_at":"2011-01-07T18:01:35Z","attachment_path":"/system/attachments/1/original/world1.png?1294423295","id":1,"user_id":1,"topic_id":1,"attachment_updated_at":"2011-01-07T18:01:35Z"}}
curl -X DELETE -H "USER_ACCESS_TOKEN: LvQmmzh6je1XzhC9XASg" http://localhost:3000/topics/1/posts/1
{}