res.set(field [, value])
将响应的 HTTP 标头 field
设置为 value
。要一次设置多个字段,请将对象作为参数传递。
Sets the response's HTTP header field
to value
. To set multiple fields at once, pass an object as the parameter.
res.set('Content-Type', 'text/plain')
res.set({
'Content-Type': 'text/plain',
'Content-Length': '123',
ETag: '12345'
})
jI6hwI00XAlFgOV2PsWoRSF7tuBUM7rU5UWV+RS/gjYZJsy7ijgQJMzpN3FqxaiVvuQ33h4pBlDsBvniLkx64WiUF0E9Oi3bgcUi/8K+T9RpLbW8VdcIDNZx1hFIFmVTv762gNoBG19WBJmhlMqRGZliyxs85zzuvCqe8D3Rfio=