Non-CRUD operations in a RESTful service

前端 未结 4 1813
梦谈多话
梦谈多话 2020-12-02 05:13

What is the \"RESTful\" way of adding non-CRUD operations to a RESTful service? Say I have a service that allows CRUD access to records like this:

GET /api/         


        
4条回答
  •  爱一瞬间的悲伤
    2020-12-02 05:42

    The RESTful way as I understand it is that you don't need new HTTP verbs, there's a noun somewhere that will mean what you need to do.

    Purchase a car? Well isn't that

    POST /api/order
    

提交回复
热议问题