Is this a bad REST URL?

前端 未结 5 1401
说谎
说谎 2021-01-03 10:18

I\'ve just been reading about REST URLs and seen the following example:

/API/User/GetUser

Now if this is accessed over HTTP with a verb GET isn\'t this a bad

5条回答
  •  离开以前
    2021-01-03 11:18

    This is not necessarily bad... it has more to do with the framework you are using to generate your rest URLs. The link @Infinity posted is a good resource, but don't limit yourself to a set theory because it can cause an excessive amount of work in certain frameworks.

    For example, there is no reason why you wouldn't want to run a GET on /API/Users/{id}/Delete to display an "are you sure" type of message before using the DELETE method.

提交回复
热议问题