The 5 Verbs of REST APIs: A Beginner’s Guide

The 5 Verbs of REST APIs: A Beginner’s Guide

The data pipelines you build as a Data engineer will move data from one location to another, often from various sources such as databases and APIs to places like data warehouses or data lakes. You will no doubt have to deal with REST API’s at some stage in let’s have a look at what REST API’s are.

In REST (REpresentational State Transfer), an API (Application Programming Interface) is a set of rules for interacting with a web service. These rules define how clients can send requests to the web service and how the service should respond to those requests. In this post, we’ll take a closer look at the five most common HTTP verbs used in REST APIs: GET, POST, PUT, DELETE, and PATCH.

  1. GET: This verb is used to retrieve data from a web service. A GET request should only retrieve data and should have no other effect.
  2. POST: This verb is used to send data to a web service to create a new resource.
  3. PUT: This verb is used to send data to a web service to update an existing resource.
  4. DELETE: This verb is used to delete a resource from a web service.
  5. PATCH: This verb is used to send data to a web service to update only a portion of an existing resource.

Conclusion

Understanding the 5 verbs of REST APIs is essential for building and consuming web services. By using the appropriate verb, you can interact with a web service and manipulate resources as needed. Whether you’re creating a new resource, updating an existing one, or deleting a resource, the right verb will ensure that your request is handled correctly.

It’s worth noting that these verbs are not the only ones that can be used in a REST API, and the specific verbs used will depend on the design of the API. However, these five verbs are the most commonly used in REST APIs.