response.statusCode


当使用隐式的响应头时(没有显式地调用 response.writeHead()),该属性控制响应头刷新时将被发送到客户端的状态码。

例子:

response.statusCode = 404;

响应头被发送到客户端后,该属性表示被发出的状态码。

When using implicit headers (not calling response.writeHead() explicitly), this property controls the status code that will be sent to the client when the headers get flushed.

response.statusCode = 404;

After response header was sent to the client, this property indicates the status code which was sent out.