The HTTP module helps you create servers to handle any HTTP request methods. These methods include GET, POST, PUT, DELETE, and OPTIONS. This video builds a server that collects data from a form that has been submitted via a POST request. You can use the provided form or create your own custom form. Alex teaches you how to gather streamed data and append the data to a file.
And the file I want to send is the contact dot HTML. … When the users fill out the form … right back to our server. … What I'm going to do is check the request method. … 'Cause if the request method is a POST request, … then I know that the user has submitted the form. … so my request object is actually a readable stream. … This is how we can read data uploaded to our server. … And we will take that data, … and I will use it to concatenate the body. … So we'll say body plus equals data. … So this is going to read all of the form elements sent … chunk by chunk by chunk. … Now in our case, there's probably … only going to be one chunk of data … 'cause we're not really collecting that much. … But sometimes with a form, you can collect a lot of data. … You can even upload files. … So that's why the request object is a stream. … If we need to send a lot of data from the form, … the request object is capable … of handling it because it's a stream. … So let's go ahead and take a look at this data. …
- Making HTTP requests
- Building web and file servers
- Installing packages with npm
- Managing and linking global packages
- Working with Express, the web server framework
- Handling POST and DELETE requests
- Creating WebSockets
- Testing and debugging Node.js code
Skill Level Advanced
Node.js: Real-Time Web with Socket.IOwith Emmanuel Henri1h 24m Intermediate
Work with VSCode1m 59s
1. The HTTP Module
3. Web Servers
5. Node.js Testing
6. Automation and Deployment
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.