I've recently gotten very into trying to think as RESTfully as possible, and I'm finding myself stymied by the non-obvious routes.
In this particular case, I'm curious about the RESTful way to check for username and email availability for a user, or anything else that has uniqueness.
My gut tells me that I would want to perform a GET
on /users/email
or /users/username/
each with a required param, or something along the lines of GET /users/search/
with optional params of email
and username
. If you get a 200
, then the username
or email
is unavailable; if you get a 404
, then it's available.
I prefer the first option since it's more explicit, but it's not like I've pored over Roy Fielding's thesis to know well enough what to do.
What's the most sound approach here?
So if you want to check the availability of Gmail username then you come to the right place. Here you can find the Free Gmail Username Availability tool that will help you to check if an email address is available for registration or not for free. Google’s Gsuite.
Explanation: As soon as username is entered in textbox the onchange event gets fired and username is passed to the checkUserName function which makes ajax call to the server side function “CheckUserNameAvailability” with the help of jquery.
Here you can find the Free Gmail Username Availability tool that will help you to check if an email address is available for registration or not for free. This tool is working for Gmail, Yahoo, Hotmail, and Outlook. It also works for another custom domain-powered email service providers.
Start with several name ideas and type each one into the search bar. Namechk takes your username idea (even random words) and checks its availability as a domain name and username on dozens of social channels and online platforms. If the name is available on a certain channel, the channel turns green.
The first approach does seem to be more "RESTful". You try to GET a specific resource (by username or email) and get it if it exists or get a status message "unavailable resource". This would be:
This should generate:
The second one seems more like "SOAP"-like web service, where you define a "function" (/users/search/) with some "parameters" (username, email)...
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