How to properly response to a Non-Resource type?!


I have an endpoint for checking the username availability.

How would you design the response of that endpoint. Normally I will say if the username is available or not but I am having a hard time thinking the data schema for that endpoint response


I see two ways.

  1. Use another API for that task. You talk to for normal business and use for small tasks that are not based on resource manipulation.

  2. Make a request to something like[username]=myusername and if a resource is returned, then that means that the username is taken.