响应头和setTimeout问题
response.writeHead(200, {‘Content-Type’: ‘text/plain; charset=UTF-8’}); response.write(“Sleeping for " + delay + " milliseconds…”); setTimeout(function() { response.end(); console.log(‘response.end()’); }, delay); NodeJS版本V0.8.16: 这样无法输出第一个response.write(),但text/plain改成text/html之后,第一个response.write就能输出在页面上了,有懂的童鞋讲一讲是什么道理吗