Closed hannahcmtucker closed 6 years ago
Usually you would only send back one HTTP status code in your response from the server:
response.writeHead(200, { 'content-type': 'text/plain' }); response.writeHead(303, { Location: '/' });
I think in this case the 303 will be probably overriding the 200.
If you want to set multiple headers on your response, you can do it by including more than one key/value pair in the object you pass to writeHead
writeHead
response.writeHead(303, { 'content-type': 'text/plain', Location: '/' });
https://nodejs.org/api/http.html#http_response_writehead_statuscode_statusmessage_headers
Usually you would only send back one HTTP status code in your response from the server:
I think in this case the 303 will be probably overriding the 200.
If you want to set multiple headers on your response, you can do it by including more than one key/value pair in the object you pass to
writeHead
https://nodejs.org/api/http.html#http_response_writehead_statuscode_statusmessage_headers