reading-notes

More CRUD

CRUD Basics

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

The HTTP method commonly used to update a record through an API is the PUT method. The PUT method is used to completely replace the representation of a resource with the one provided in the request

Which REST methods require an ID parameter?

GET, PUT, DELETE

Speed Coding: Building a CRUD API

What’s the relationship between REST and CRUD?

REST (Representational State Transfer) is an architectural style for designing networked applications, while CRUD (Create, Read, Update, Delete) represents the basic operations that can be performed on data. REST provides architectural principles and guidelines for designing scalable and interoperable web services, while CRUD defines the basic data operations that can be performed on resources within an application or system

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

  1. Identify and Define Resources: Determine the entities or objects that will be exposed through the API and clearly define their properties and relationships.

  2. Design the Resource URIs: Create intuitive and hierarchical URIs that uniquely represent each resource’s identity.

  3. Choose and Implement HTTP Methods: Select appropriate HTTP methods (GET, POST, PUT, PATCH, DELETE) for CRUD operations on the resources and implement the corresponding logic.

  4. Define the Request and Response Formats: Specify the data formats (e.g., JSON, XML) for requests and responses, determining the structure and content of the exchanged data.

  5. Implement Error Handling and Security: Establish mechanisms for handling errors, providing meaningful error messages and proper status codes. Implement security measures, such as authentication and authorization, to ensure API access control.

Things I want to know more about