大网数据广告活动
网站运营与故障问答

What is the most relevant HTTP status when waiting for user activation?

· 52CE 我爱测

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.

问题原文

原帖链接 · AlterPHP · CC BY-SA 3.0

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.

已采纳解答

原帖链接 · Kenny Grant · CC BY-SA 3.0

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.

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Webmasters Stack Exchange
适用范围
以原帖系统、软件版本与发布日期为准(2017-08-23)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。