REST: what's the name for the HTTP verb and endpoint?

為{幸葍}努か 提交于 2019-12-06 23:48:46

问题


Given this:

GET /users

/users is called endpoint in REST terminology.

How do you call the whole GET /users (verb + endpoint) instead? I hope there is one word for it.

Thanks.


回答1:


You probably won't like this answer, but here it is anyway: REST does not use the terminology "endpoint" at all. You can check Fielding's thesis yourself: http://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm - open the PDF and search for "endpoint".

Fumanchu's answer is probably the closest you get: "/Users" is a relative path and can be used as the Request-URI in the Request-Line as per the 2616 HTTP spec.

In a web API documentation I would probably call "/Users" an "Endpoint" reference as you do, and "GET /Users" would be an "Operation". Maybe you can get some inspiration here: https://nhs.3scale.net/docs




回答2:


The API Bluprint Language Specification refers to the HTTP method, when applied to a resource, as a resource action. This name seems to be consistent with the terminology in section 5.2.1.2 Representations, of Fielding's dissertation.




回答3:


RFC 2616 (the HTTP spec) calls the first line of a request the "Request-Line". It consists of the method, Request-URI, and version. See http://tools.ietf.org/html/rfc2616#section-5.1 for complete details.




回答4:


We call it 'resource operation'

Basically, you are mapping your operations like

  • Create a new user
  • Get User info
  • Update User info
  • Remove user

to "HTTP verb + Resource"

  • POST /user/
  • GET /user/
  • PUT /user/
  • DELETE /user/


来源:https://stackoverflow.com/questions/18588318/rest-whats-the-name-for-the-http-verb-and-endpoint

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!