Examine a POST example and implement an update with PUT. A challenge introduced in this video is to create a DELETE endpoint to remove quotes.
- [Instructor] Now let's dive a little deeper…and take a look at write functionality.…The application needs to be able to create new quotes…for the list, update existing quotes, and delete quotes.…Once we've done all of that we'll have…a complete cred application.…Open your text editor with the code for this video.…This version has a post action to add new quotes…so let's take a look at that before we add an update method.…Scroll down to Rest API routes…and look at the quotes endpoint.…In a Rest API world new objects should be created as a post…to a list, so we will accept post requests to the quotes…endpoint for creating new items.…
You may remember that when we created the route for…individual quotes we used parameters expressed in the URL.…For a post we'll need to look at the content…of the post body instead.…This is stored in request.body.…The first thing we need to do is make sure…that they're sending us a valid quote.…For this demo I'm keeping it simple, so I'm just declaring…that the quote has to have content.…
- Why become a polyglot programmer?
- Exploring Node.js, Python, Perl, and Ruby code
- Building on prior knowledge to learn new programming languages
- Learning API read and write functionality in Node.js, Python, Perl, and Ruby
- Implementing API functionality in Node.js, Python, Perl, and Ruby
Skill Level Intermediate
Building APIs Using Hapi in Node.jswith Kirsten Hunter2h 23m Intermediate
1. Becoming a Polyglot
Next steps1m 19s
- 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.