If we want to be able to receive POST data, we have to instruct our server how to accept and handle a
POST request. In PHP, we could access our POST values seamlessly with
$_POST['fieldname'], because it would block until an array value was filled. Contrariwise, Node provides low-level interaction with the flow of HTTP data, allowing us to interface with the incoming message body as a stream, leaving it entirely up to the developer to turn that stream into usable data
Let's create a
server.js file ready for our code, and an HTML file called
form.html, that contains the following:
<form method=post> <input type=text name=userinput1><br> <input type=text name=userinput2><br> <input type=submit> </form>
For our purposes, ...