Explore POST for creating new items in Perl/Dancer. Overview the PUT command, and challenge yourself to implement DELETE with some error handling.
- [Instructor] Now we're ready to get started working…with the write operations using Perl and Dancer.…As usual, we need a post for the list level…to create new items, and a put and delete…on individual items to update and remove things…from the system.…We're starting out with the post defined again,…so let's take a look at it.…We'll walk through it to understand…how the pieces fit together.…Again, we have the definition of the function…with the fat arrow,…clearly saying that I am looking for posts to API quotes,…and when that happens, I'm going to do these things.…
What those things are, the first thing is find the quote…with the highest index number in the database…and set the id to that number plus one,…so we're sure we have a safe number.…Check for the content.…If there's no content, send back a 400…with a message explaining why.…Build up the response and then send the response…to the quotes collection in the Mongo database.…Again, you can see that we're sending a reference…to the hash into the database for processing.…
- 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.