Skip to content

Instantly share code, notes, and snippets.

@karlseguin
Created November 10, 2011 12:03
Show Gist options
  • Select an option

  • Save karlseguin/1354705 to your computer and use it in GitHub Desktop.

Select an option

Save karlseguin/1354705 to your computer and use it in GitHub Desktop.

Revisions

  1. Karl Seguin revised this gist Nov 10, 2011. 1 changed file with 5 additions and 1 deletion.
    6 changes: 5 additions & 1 deletion gistfile1.txt
    Original 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...)
    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
  2. Karl Seguin created this gist Nov 10, 2011.
    37 changes: 37 additions & 0 deletions gistfile1.txt
    Original 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