“正在加载"的HTTP状态代码
服务器接收到一个请求,但是决定该请求将花费很长时间才能处理,因此它以一个表示正在加载... 的站点作为响应.该站点将刷新自身,直到客户端收到表明(第一个)请求已被完全处理的响应为止.
A server receives a request, but decides that the request will take to long to process, so it responds with a site saying Loading.... The site will refresh itself until the client receives the response indicating that the (first) request has been completely processed.
此正在加载... 网站最合适的状态代码是什么?
What's the most appropriate status code for this Loading... site?
我的猜测是它被 202接受.
HTTP是一个请求/响应协议.每个请求都返回一个响应.
HTTP is a request/response protocol. Each request returns a single response.
在您的示例中,初始请求成功返回了您的加载页面,因此"成功" 200代码是合适的.
In your example, the initial request successfully returns your loading page, and so the "success" 200 code is appropriate.
您在此页面然后生成更多数据的示例在HTTP的不同层上工作,因此不需要在HTTP级别添加语义
Your example of this page then generating further data is working at a different layer to HTTP, and so doesn't need to add semantics to the HTTP level