这个HTTP响应状态码是什么意思?
对于我正在构建的 RESTful API,我在 Ruby 服务器日志中收到以下响应代码:HTTP/1.1" 200 203
我知道 200 表示 OK,但是 203 是做什么用的?当然有只能是一个状态代码?
完整的响应是:
"GET /getLocationForAllFriends?uid=4&passport=0000 HTTP/1.1" 200 203 0.4243
"GET /getLocationForAllFriends?uid=5&passport=0000 HTTP/1.1" 200 8 0.3206
除了 203 和 8 所在的“槽”之外,一切都有意义
,服务器是 Mongrel 。
For a RESTful API I am building, I'm getting the following response code in the Ruby server log: HTTP/1.1" 200 203
I know 200 means OK, but then whats the 203 for? Surely there can only be one status code?
The full responses are:
"GET /getLocationForAllFriends?uid=4&passport=0000 HTTP/1.1" 200 203 0.4243
"GET /getLocationForAllFriends?uid=5&passport=0000 HTTP/1.1" 200 8 0.3206
Everything makes sense except for the "slot" where 203 an 8 are.
BTW, the server is Mongrel
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
203 是返回数据的字节长度,它不是响应代码。
第一行响应为 203 字节,服务时间为 0.4 秒,第二行响应为 8 字节,服务时间为 0.3 秒。两者都是
GET
请求,响应代码均为200
。The 203 is the length in bytes of the returned data, it is not a response code.
The response in the first line was 203 bytes and took 0.4 seconds to serve, and the second was 8 bytes and took 0.3 seconds. Both were
GET
requests and the response code was in both cases200
.203 是响应的长度。
203 is the length of the response.
203 表示
非权威信息
(或者“服务器成功处理了请求,但返回的信息可能来自其他来源”)。但是,我敢打赌,这并不是您正在查看的真正 HTTP 状态代码,特别是因为您在另一个案例中得到了 8。查看服务器配置文件以了解它实际记录的内容。
编辑:从其他答案来看,这可能是响应的长度(以字节为单位)。
203 means
Non-Authoritative Information
(or, "The server successfully processed the request, but is returning information that may be from another source").But, I would bet that it's not really an HTTP status code you're looking at, especially since you get an 8 in another of your cases. Take a look in the server config file to see what it is that it's actually logging.
Edit: Judging from the other answers, it's probably the length of the response (in bytes).