I was under the impression that REST was supposed to use routing, like this:
Rather than something like this:
http://server/api/accounts?id=2
I've seen lots of examples using the query string, but I would've expected people to be saying that's wrong. However, that doesn't seem to be the case.
For an [HTTPGET], should I prefer one over the other?
Path parameter is used to identify a specific resource or resources.
Query parameter is used to sort/filter those resources.
It is a good practice to make all required parameters as path parameters, and all optional as query parameters.
In your case, if your
:idparameter uniquely identifies an account, this should be a path parameter, i.e.:/api/accounts/:id