這篇文章主要介紹了node.js中的http.response.addTrailers方法使用說明,本文介紹了http.response.addTrailers的方法說明、語法、接收參數、使用實例和實現源碼,需要的朋友可以參考下
方法說明:
該棒法用來將HTTP trailing響應頭添加到消息尾部。
語法:
復制代碼代碼如下:
response.addTrailers(headers)
接收參數:
headers 響應頭信息
例子:
復制代碼代碼如下:
response.writeHead(200, { 'Content-Type': 'text/plain', 'Trailer': 'Content-MD5' });
response.write(fileData);
response.addTrailers({'Content-MD5': "7895bf4b8828b55ceaf47747b4bca667"});
response.end();