View our GitHub

Please visit sails-docs on GitHub to view documentation on your mobile device.

Edit Page


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);




res.set('Content-Type', 'text/plain');

  'Content-Type': 'text/plain',
  'Content-Length': '123',
  'ETag': '12345'

Is something missing?

If you notice something we've missed or could be improved on, please follow this link and submit a pull request to the sails-docs repo. Once we merge it, the changes will be reflected on the website the next time it is deployed.


We wrote a book!

Get early access to the book
with promotion code: mcneildoc

Get the Book