【发布时间】:2012-07-17 21:26:11
【问题描述】:
我正在寻找在 Nodejs 的 http 响应中添加重复的 HTTP 标头,例如:
HTTP/1.1 206 Partial Content
Content-Length: 1234567
Content-Type: video/ogg
Content-type: multipart/byteranges; boundary=THIS_STRING_SEPARATES
我使用的是Nodejs提供的http模块,当我发送响应头时,我只能定义一个“Content-Type”头:
var header = {};
header['Content-Type'] = "video/ogg";
或
header['Content-Type'] = "multipart/byteranges; boundary=THIS_STRING_SEPARATES";
是否可以在响应中同时包含“Content-Type”?谢谢。
【问题讨论】:
-
我假设使用
header['Content-type'](一个字母小写)不起作用? -
您好,感谢您的快速回复。我试图将“内容类型”和“内容类型”都放入标题中,但在客户端我只能看到最后定义的那个。
标签: node.js http-headers httpresponse