1
我正在使用expressjs作爲框架在nodejs中編寫一個restful api。我有以下代碼在express.js中發送響應之前讀取Etag值
.get(function(request,response)
{
Production.find(function(err, prods) {
if (err)
response.send(400, {success:false, error: err});
response.send(200, prods);
console.log(response._headers);
});
});
現在我想在實際發送響應之前讀取響應的標題。我希望這樣可以讀取ETag值,並檢查是否應該再次發送數據。
有什麼想法嗎?
感謝
你看了[etag](https://www.npmjs.com/package/etag)節點模塊嗎? etag有很多npm模塊。 – randominstanceOfLivingThing
謝謝,我會調查它 – Kelly