I have an api like
http://api.mycompany.com/products/bycategory/{category_id}
How the ending part /products/bycategory/{category_id}
is named? If I remove the domain part, how can I name the rest if I put it in web.config, for instance?
URI? I looked at some articles but I was confused. Sometimes the full Url seems to be the URI others the mentioned remaining part.
Thanks.
An URL is made up of these parts:
http://
api.mycompany.com
/products/bycategory/{category_id}
?key=value&otherKey=otherValue
It's up to the server how to interpret the path and query string. A simple web server may just serve the file pointed to by the path. An application server may interpret the path as a query.
The REST resource naming guide talks about "resources" which makes sense since first a URL is-a uniform resource identifier (URI). URIs also use the term "path".
See this question on REST API naming guidelines and its answers, the term used there is "path" as well.
I'd also use "path".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With