writeHead()

The ServerResponse method that sends the status code and headers of an HTTP response in one go.

In more detail

After it runs the headers are fixed, so set every header first. If you never call it, Node.js sends the headers when you first write the body.

Related terms

Taught in

References