2

I'm coding a user registration process and wondering if 200 (OK) is the most relevant HTTP status for response after username/password creation, when waiting for user activation.

HTTP status 202 (accepted) seems relevant too.

2

It depends what you do after registration and what kind of website:

  1. If an api 200 is fine (201 or 202 would be ok but unusual)
  2. If a website 200 is fine if showing information
  3. If a website, 302 is also fine if you're redirecting to a more useful page after creation (with an informational message).

Very few websites use codes other than 100,200,301,302,400,401,403,404,500, it's best not to get too hung up on which one you're using, as in practice most clients will treat them as broad classes (10x,20x,30x,40x,50x), and it won't matter which you choose.

  • Thanks for your complete answer. I actually want to hang up on which one to use in my case ;-) I'm in your second case... – AlterPHP Aug 25 '17 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.