Give me a example of non-RESTful design?

前端 未结 4 1471
悲&欢浪女
悲&欢浪女 2021-02-19 05:18

I learned the term \"RESTful\" as a Rails developer. After reading wikipedia, also here and here.

I don\'t get it. It seems to me, Rails is only using a concise<

4条回答
  •  南笙
    南笙 (楼主)
    2021-02-19 06:07

    It seems to me, Rails is only using a concise way to describe URLs. It seems to me every URI is RESTful, in it's designed scope.

    URIs are neither RESTful or non-RESTful. REST is an architectural style for which you need to consider the overall application.

    GET is the method for the retrieval request. If you want to put this in the context of the REST dissertation, if your GET request has side-effects, it will then break a few other constraints, for example regarding the cache.

    You could also potentially design a RESTful system where a GET /delete?student_id=3 request gives you a representation telling you (or asking you to confirm) that you want to delete that student, so long as it doesn't actually perform the delete operation.

提交回复
热议问题