The GET method provides a shorter way of sending an HTTP request with the HTTP module. Once you supply a URL, you can send a request, and when you pass a callback function, this captures the response and listen for the data as a stream.
- [Narrator] In the previous video, … we used the HTTPS module to make … a request to Wikipedia. … We specifically used the request function … of the HTTPS module that you can see here … on line seven of our file. … So this module's a little bit complicated … because you have to supply all of the … options for that request, … but the HTTP in HTTPS modules provide an easier way. … Let's take a look at the webpage … that we're making a request for. … On the last lesson we requested Snoopy, … in this lesson we're going to go ahead … and request Charlie Brown, Charlie_Brown, … so what we're going to make is a get request for Charlie Brown. … So HTTPS comes with a get function to make this easier. … I'm simply going to copy the uRL, … I will delete all of the options here on line four. … So we're going to use the HTTP get method, … this will make a get request so we don't … have to supply an options.method. … All we need to do is supply the URL … and because we're using the HTTPS module, …
- 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.