I'm working through the tutorial in the beginner node book and I'm putting in this code.
var body = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8"/>
</head>
<body>
<form action="/upload" method="post">
<textarea name="text" rows="20" cols="60"></textarea>
<input type="submit" value="Submit text"/>
</form>
</body>
</html>';
response.writeHead(200,{"Content-Type" : "text/plain"});
response.write(body);
response.end();
I've spaced it out, but I know I need to put it all on one line, when I do, the textarea does not appear, the html as written appears on screen.
I've spaced it out because I'm not sure if the html is correct.
What's going wrong?
"text/html"instead of"text/plain"(on the third-last line)?