More CRUD

We have been working on our Can of Books project for this module. Last lab we added the functionality for the user to create a book resource in the database or to delete one. This topic matters as it relates to learning more HTTP methods to continue building on our app.


CRUD Basics

Which HTTP method would you use to update a record through an API?

The PUT method. It replaces all current data of the target resource with the uploaded content. We target the resource using the id in the route.

Which REST methods require an ID parameter?

PUT and DELETE.


Speed Coding: Building a CRUD API

What’s the relationship between REST and CRUD?

REST uses the HTTP methods POST, GET, PUT and DELETE to allow users to Create, Read, Update and Delete (CRUD).

If you had to describe the process of creating a RESTful API in 5 steps, what would they be?

  1. Identify Resources.
  2. Create URIs.
  3. Determine how the data will be presented.
  4. Assign HTTP methods for CRUD operations.
  5. Error handling and any other actions needed for app functionality.

Things I want to know more about

  • I would like to know more about the different approaches for creating a RESTful APIs.

-back