Created
November 10, 2011 12:03
-
-
Save karlseguin/1354705 to your computer and use it in GitHub Desktop.
Revisions
-
Karl Seguin revised this gist
Nov 10, 2011 . 1 changed file with 5 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,8 @@ You build an endpoint that takes in data and saves it. This is a service that takes in data from outside sources, the user can be any type. (some sites use integers, some use strings, some guids...) 3 samples: POST /notes -
Karl Seguin created this gist
Nov 10, 2011 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,37 @@ You build an endpoint that takes in data and saves it. This is a service that takes in data from outside sources, the user can be any type (some sites use integers, some use strings, some guids...) 3 samples: POST /notes { user: 9000 message: 'over' } POST /notes { user: 'vegeta' message: 'over 9000!' } POST /notes { user: '9002' message: 'blah' } Now we want to let people get the data: GET /notes/9000 id = request[:id] Right now, id is a string. But, if I use a string to look up, It won't return anything. GET IS FAIL