Recently, I tried very hard to think as soon as possible, and I am at a standstill along non-obvious routes.
In this particular case, I'm curious how RESTful checks for a username and email for a user or something else that is unique.
My gut tells me that I would like to execute a GET on /users/email or /users/username/ each with the required parameter or something like the GET /users/search/ lines with optional email and username parameters. If you get 200 , then username or email not available; if you get 404 then it is available.
I prefer the first option, since it is more explicit, but that’s not how I appreciated Roy Fielding's thesis to know well what to do.
What is the most sound approach here?
source share