What am I not understanding about REST?

后端 未结 7 1603
误落风尘
误落风尘 2020-11-28 23:55

I\'m building a framework and want developers who build with it to have the ability to allow parts of it to both share data with other sites and allow other sites to add/edi

7条回答
  •  鱼传尺愫
    2020-11-29 00:26

    I'll take a stab at what it might look like RESTful.

    /books.php?category=ruby

    GET /search?type=books&category=ruby
    

    /books.php?id=23

    GET /books/23 (or /books/23.xml)
    

    /books.php?action=add&title=AdvancedRuby&description=....&securityId=923847203487

    POST /books
    title=AdvancedRuby&description=A+great+book...
    

    /books.php?action=delete&id=342&securityId=923847203487

    DELETE /books/342
    

    Many developers stick to GET and POST in which case the last one might be:

    POST /books/342
    status=Deleted
    

提交回复
热议问题