What do you call the combination of endpoint and HTTP method in a REST API?
https://softwareengineering.stackexchange.com/questions/414734
-
14-03-2021 - |
Frage
Let's use the Twitter API as an example. My understanding is that we refer to /statuses/update
as an endpoint and we refer to POST
as a HTTP method.
So what would term do you use to refer to the pair of these two things combined, i.e. POST /statuses/update
?
"Endpoint". It seems most conventional to also refer to the combination as "endpoint". See for example: Stripe's documentation of some of its "endpoints" here or this overview page for Twitter. The only problem is when I'm in a verbal conversation with someone saying "endpoint", it is sometimes ambiguous whether I mean just the end path
/statuses/update
or the combinationPOST /statuses/update
."Request method" or "API method". For example, Slack's REST API documentation refers to the end paths as "method URLs" and the collection of these as "API methods". Some API docs will list these pairs in the following manner:
Available methods
POST /statuses/update
GET /statuses/lookup
Lösung
So what would term do you use to refer to the pair of these two things combined, i.e.
POST /statuses/update
?
IMO that depends on the level of detail you want to describe:
- You could use REST API method for the general case. This makes it clear you'll need to have a REST endpoint in combination with an arbitrary HTTP command (in the end you can define your own, as long the server understands how to dispatch them, see HTTP Methods)
- You could classify the method further like
- REST API read method (e.g. for
GET
) - REST API write method (e.g. for
POST
,DELETE
, etc.)
- REST API read method (e.g. for