I noticed that there are couple of ways one can use to get a resource using rest API. I am currently trying to find a valid pros/cons on each of these technique in order to adopt them at the larger scale.
What would be the main differences between these requests? Why would I add id into the path, and not into querystring or request body? Does it have to do with caching or only with resource centered conventions?
[HttpGet]
http://doamin.com/resources/{id}/?filter1=a,filter2=b,
or
http://doamin.com/resources/?filter1=a,filter2=b,id=500
instead of
[HttpPost]
http://doamin.com/resources
Body
{
id: 100,
filter1: "a",
filter2: "b"
}
or
[HttpPost]
http://doamin.com/resources/{id}
Body
{
filter1: "a",
filter2: "b"
}
I find it much more easier to develop endpoints using Post, but I would really like to consider possible issues a developer who will consume these endpoints would actually have.