What HTTP error code to return for name already taken?

Ryan picture Ryan · Sep 30, 2012 · Viewed 8.8k times · Source

I'm doing an AJAX call to set the username. If the username is already taken what HTTP code should I return?

Answer

Navrattan Yadav picture Navrattan Yadav · Jun 6, 2014

You can use 409 Conflict.

Indicates that the request could not be processed because of conflict in the current state.