Sets specified response header (header
) to the specified value (value
).
Alternatively, you can pass in a single object argument (headers
) to set multiple header fields at once, where the keys are the header field names, and the corresponding values are the desired values.
res.set(header, value);
-or-
res.set(headers);
res.set('Content-Type', 'text/plain');
res.set({
'Content-Type': 'text/plain',
'Content-Length': '123',
'ETag': '12345'
})