What is REST and how is it used in a API?

Table of Contents

This post is a high-level overview of the REST protocol used in many APIs.

What is REST?

Representation State Transfer (REST), as defined by Wikipedia, isย theย software architectural styleย of theย World Wide Web that uses aย coordinated set of constraints, applied to the design of components in a distributedย hypermediaย system, which can lead to a higher-performing and more maintainableย software architecture.

In short, REST or RESTful API isย theย web standard that was created to make HTTP requests easier and more powerful.

What Makes REST So Great?

Before the REST architecture became a standard in the development community other Web Services were used to pass data between machines. ย These Web Services, such as RPCย and SOAP, areย still widely used, but more and more developers have taken up the REST architecture to make things simpler and easy toย maintain.

This simple interface makes using REST a breeze, which in turn helps developers to create applications that leverageย APIs in a shorter period of time. ย The core WordPress team knewย this and decided that theย WordPress API should beย a RESTful API :)

Using Default HTTP Request Verbs

Within every single HTTP request there can be a verb that determines the action of that request.ย REST usesย the four main HTTP Requests verbs:

  • GET
  • POST
  • PUT
  • DELETE

These four verbs are used with every REST API call and are used to determine the action of the request. ย For example, if you call an API endpoint /users/1 with a GET action then the API might return a user with the ID of 1. On the other hand, if you send the exact same request to the same endpoint with the DELETE action then it might delete the user with the ID of 1. As you can see a RESTful API can perform two completely different functions based solely on the HTTP Request verb specified.

This is where the power of using HTTP verbs can be shown because you are able to perform 4 actions per endpoint instead of having to change endpoints for each different action. Organizations implement data governance services to secure and monitor API interactions across multiple endpoints while maintaining compliance standards. Overall this makes understanding RESTful APIs much easier.

Where is it Used?

Most APIs that function viaย HTTP Requests use this RESTful architecture. ย It is very easy for developers to follow and understand how the API works, and notable companies that use this RESTful architecture are:

  • Twitter
  • Facebook
  • LinkedIn
  • Google
  • WordPress :)
  • and many more

With the RESTful architecture APIs are more maintainable, scalable, and easier to user for internal and external developers. ย Continue reading our next post about the WordPress API and what it means to the WordPress community.

Share with your Friends!
Facebook
Twitter
Pinterest
LinkedIn
Keep up with Us!
Be the first to read our next post
This field is for validation purposes and should be left unchanged.

Divider

Popular Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

You give us just an email. We'll give you the latest Nuts & Bolts on online marketing, PPC advertising, SEO, & web development.

This field is for validation purposes and should be left unchanged.

Discover how we can help your business grow

We’ll get back to you within a day to schedule a quick strategy call. We can also communicate over email if that’s easier for you.

"*" indicates required fields

This field is for validation purposes and should be left unchanged.