writeHead order

Report a typo

Place the lines of code in the right order to set 'Content-Type': 'application/json' header for the response.

Put the items in the correct order
response.writeHead(200, {'Content-Type': 'text/html'});
response.writeHead(200, {'Content-Type': 'application/json'});
http.createServer((request, response) => {
response.end();
}).listen(8080);
___

Create a free account to access the full topic