Skip to content

Instantly share code, notes, and snippets.

@ksdev-pl
Last active August 29, 2015 14:01
Show Gist options
  • Select an option

  • Save ksdev-pl/b4ff45b8d7d41e2fe178 to your computer and use it in GitHub Desktop.

Select an option

Save ksdev-pl/b4ff45b8d7d41e2fe178 to your computer and use it in GitHub Desktop.

Revisions

  1. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 9 additions and 8 deletions.
    17 changes: 9 additions & 8 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -27,13 +27,14 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api


    __200__: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
    401: unauthorized (bad authentication)
    403: forbidden (authenticated but not enough permissions)
    404: document not found
    409: document already exists
    500: internal server error
    __201__: success (and something has been created)
    __204__: success (and something has been deleted)
    __400__: bad request
    __401__: unauthorized (bad authentication)
    __403__: forbidden (authenticated but not enough permissions)
    __404__: document not found
    __409__: document already exists
    __500__: internal server error
  2. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

    _200_: success
    __200__: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
  3. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -27,9 +27,8 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api


    200: success
    _200_: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
  4. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 10 additions and 10 deletions.
    20 changes: 10 additions & 10 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -27,14 +27,14 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api



    - 200: success
    - 201: success (and something has been created)
    - 204: success (and something has been deleted)
    - 400: bad request
    - 401: unauthorized (bad authentication)
    - 403: forbidden (authenticated but not enough permissions)
    - 404: document not found
    - 409: document already exists
    - 500: internal server error
    200: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
    401: unauthorized (bad authentication)
    403: forbidden (authenticated but not enough permissions)
    404: document not found
    409: document already exists
    500: internal server error
  5. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api


    - 200: success
    - 201: success (and something has been created)
  6. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -29,12 +29,12 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api


    * 200: success
    * 201: success (and something has been created)
    * 204: success (and something has been deleted)
    * 400: bad request
    * 401: unauthorized (bad authentication)
    * 403: forbidden (authenticated but not enough permissions)
    * 404: document not found
    * 409: document already exists
    * 500: internal server error
    - 200: success
    - 201: success (and something has been created)
    - 204: success (and something has been deleted)
    - 400: bad request
    - 401: unauthorized (bad authentication)
    - 403: forbidden (authenticated but not enough permissions)
    - 404: document not found
    - 409: document already exists
    - 500: internal server error
  7. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -28,6 +28,7 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api


    * 200: success
    * 201: success (and something has been created)
    * 204: success (and something has been deleted)
  8. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 9 additions and 9 deletions.
    18 changes: 9 additions & 9 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -28,12 +28,12 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

    200: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
    401: unauthorized (bad authentication)
    403: forbidden (authenticated but not enough permissions)
    404: document not found
    409: document already exists
    500: internal server error
    * 200: success
    * 201: success (and something has been created)
    * 204: success (and something has been deleted)
    * 400: bad request
    * 401: unauthorized (bad authentication)
    * 403: forbidden (authenticated but not enough permissions)
    * 404: document not found
    * 409: document already exists
    * 500: internal server error
  9. ksdev-pl revised this gist Jun 27, 2015. 1 changed file with 11 additions and 1 deletion.
    12 changes: 11 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -26,4 +26,14 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?state=closed&sort=-updated_at` - Retrieve recently closed tickets
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api

    200: success
    201: success (and something has been created)
    204: success (and something has been deleted)
    400: bad request
    401: unauthorized (bad authentication)
    403: forbidden (authenticated but not enough permissions)
    404: document not found
    409: document already exists
    500: internal server error
  10. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 0 additions and 1 deletion.
    1 change: 0 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -26,5 +26,4 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?state=closed&sort=-updated_at` - Retrieve recently closed tickets
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`

    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
  11. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -27,4 +27,4 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`

    http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
    * http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
  12. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -25,4 +25,6 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo
    * `GET /tickets?sort=-updated_at` - Retrieve recently updated tickets
    * `GET /tickets?state=closed&sort=-updated_at` - Retrieve recently closed tickets
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`

    http://www.vinaysahni.com/best-practices-for-a-pragmatic-restful-api
  13. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -19,9 +19,10 @@ GET | /photos/:id/edit | photos#edit | return an HTML form for editing a photo
    PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo

    * `PUT /gists/:id/star`
    * `/stores?search=near&lat=12.34&lon=-12.34`
    * `/collection/element/collection?foo=bar&filter=green`
    * `GET /tickets?sort=-updated_at` - Retrieve recently updated tickets
    * `GET /tickets?state=closed&sort=-updated_at` - Retrieve recently closed tickets
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * `PUT /gists/:id/star`
    * To make the API experience more pleasant for the average consumer, consider packaging up sets of conditions into easily accessible RESTful paths. For example, the recently closed tickets query above could be packaged up as `GET /tickets/recently_closed`
  14. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -21,4 +21,7 @@ DELETE | /photos/:id | photos#destroy | delete a specific photo

    * `/stores?search=near&lat=12.34&lon=-12.34`
    * `/collection/element/collection?foo=bar&filter=green`
    * `GET /tickets?sort=-updated_at` - Retrieve recently updated tickets
    * `GET /tickets?state=closed&sort=-updated_at` - Retrieve recently closed tickets
    * `GET /tickets?q=return&state=open&sort=-priority,created_at` - Retrieve the highest priority open tickets mentioning the word 'return'
    * `PUT /gists/:id/star`
  15. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -20,4 +20,5 @@ PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo

    * `/stores?search=near&lat=12.34&lon=-12.34`
    * `/collection/element/collection?foo=bar&filter=green`
    * `/collection/element/collection?foo=bar&filter=green`
    * `PUT /gists/:id/star`
  16. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -19,5 +19,5 @@ GET | /photos/:id/edit | photos#edit | return an HTML form for editing a photo
    PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo

    `/stores?search=near&lat=12.34&lon=-12.34`
    `/collection/element/collection?foo=bar&filter=green`
    * `/stores?search=near&lat=12.34&lon=-12.34`
    * `/collection/element/collection?foo=bar&filter=green`
  17. ksdev-pl revised this gist Aug 16, 2014. 1 changed file with 4 additions and 1 deletion.
    5 changes: 4 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,7 @@ POST | /photos | photos#create | create a new photo
    GET | /photos/:id | photos#show | display a specific photo
    GET | /photos/:id/edit | photos#edit | return an HTML form for editing a photo
    PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo

    `/stores?search=near&lat=12.34&lon=-12.34`
    `/collection/element/collection?foo=bar&filter=green`
  18. ksdev-pl revised this gist Jul 4, 2014. No changes.
  19. ksdev-pl revised this gist May 5, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -17,4 +17,4 @@ POST | /photos | photos#create | create a new photo
    GET | /photos/:id | photos#show | display a specific photo
    GET | /photos/:id/edit | photos#edit | return an HTML form for editing a photo
    PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE /photos/:id photos#destroy delete a specific photo
    DELETE | /photos/:id | photos#destroy | delete a specific photo
  20. ksdev-pl revised this gist May 5, 2014. 1 changed file with 12 additions and 1 deletion.
    13 changes: 12 additions & 1 deletion restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -6,4 +6,15 @@ POST | /resource | store | resource.store
    GET | /resource/{resource} | show | resource.show
    GET | /resource/{resource}/edit | edit | resource.edit
    PUT/PATCH | /resource/{resource} | update | resource.update
    DELETE | /resource/{resource} | destroy | resource.destroy
    DELETE | /resource/{resource} | destroy | resource.destroy


    HTTP Verb | Path | Controller#Action | Used for
    ----------|-------|-------------------|---------
    GET | /photos | photos#index | display a list of all photos
    GET | /photos/new | photos#new | return an HTML form for creating a new photo
    POST | /photos | photos#create | create a new photo
    GET | /photos/:id | photos#show | display a specific photo
    GET | /photos/:id/edit | photos#edit | return an HTML form for editing a photo
    PATCH/PUT | /photos/:id | photos#update | update a specific photo
    DELETE /photos/:id photos#destroy delete a specific photo
  21. ksdev-pl revised this gist May 5, 2014. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,5 @@
    Verb | Path | Action | Route | Name
    ------|------|---------|--------|------
    Verb | Path | Action | Route Name
    ------|------|---------|------------
    GET | /resource | index | resource.index
    GET | /resource/create | create | resource.create
    POST | /resource | store | resource.store
  22. ksdev-pl revised this gist May 5, 2014. No changes.
  23. ksdev-pl created this gist May 5, 2014.
    9 changes: 9 additions & 0 deletions restful_routes.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,9 @@
    Verb | Path | Action | Route | Name
    ------|------|---------|--------|------
    GET | /resource | index | resource.index
    GET | /resource/create | create | resource.create
    POST | /resource | store | resource.store
    GET | /resource/{resource} | show | resource.show
    GET | /resource/{resource}/edit | edit | resource.edit
    PUT/PATCH | /resource/{resource} | update | resource.update
    DELETE | /resource/{resource} | destroy | resource.destroy