Is this a bad REST URL?

前端 未结 5 1431
说谎
说谎 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 10:55

    /API/User/GetUser is not RESTful. Using a verb to identify a resource is not good thing. The example url is still valid but that doesn't make it right either. It is as wrong as the following declaration

    String phoneNumber = "jhon@gmail.com";
    

提交回复
热议问题