200表示请求是否已成功启动或成功完成?

时间:2013-05-17 01:12:34

标签: http

我意识到这可能听起来像一个奇怪的问题,但我在网络电话中看到了一些奇怪的结果,所以我想弄清楚我是否误解了一些东西。

我看到在孤立事件中,当我上传数据时,即使响应为200,数据也不会出现在服务器上。我的猜测是,在初始HTTP握手期间,200响应到来,然后事后出现问题。这是对事件顺序的正确解释吗?或者,一旦服务器收集了发送标头告诉它在请求中的任何数据,就交付200了吗? (因为如果是这样的话,我会回到绘图板上,看看我是怎么看到的。)

3 个答案:

答案 0 :(得分:5)

这意味着它已成功完成。来自HTTP /1.1 Spec

10.2.1 200 OK

The request has succeeded. The information returned with the response is dependent on the method used in the request, for example:

GET an entity corresponding to the requested resource is sent in the response;

HEAD the entity-header fields corresponding to the requested resource are sent in the response without any message-body;

POST an entity describing or containing the result of the action;

TRACE an entity containing the request message as received by the end server.

答案 1 :(得分:2)

成品。否则,它没有任何意义。可能出现问题,代码可能会出错。当服务器已经发送200 OK时,服务器如何发送该错误代码。

您遇到的可能是滞后,缓存,在服务器发送200等后运行的分离线程。

答案 2 :(得分:1)

成功回复(如200)在服务器收到并处理完整请求之后才会发送。另一方面,可以在完全接收请求之前发送错误答复。如果发生这种情况,请停止发送您的请求。