Which HTTP response code for “This email is already registered”?

Yes, 409 is the most appropriate response code here. Even though you are most likely returning 201 on success, you’re still POSTing to a resource which is described as a collection, and POSTing a duplicate email is definitely a conflict with “the current state of the resource” as a collection. You should return a response body with a description of the problem, and hyperlinks to help resolve the problem, if possible.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)