I have written a small API which uses the Node js \"restify\" framework. This API receives a request (actually anything after \"/\") and then send that request to another se
I can't find response.send() in the docs, but I assume .send() will fill in and send the response so can only be called once, whereas .write() will just write the response, but you have to send it using response.end()
This means you can edit the headers using .write() because the response has not been sent yet.
EDIT :
response.send() is part of the restify Response API wrapper