What is a RESTful API in simple terms?

713 views

What is a RESTful API in simple terms?

In: Technology

2 Answers

Anonymous 0 Comments

So an API is an Application Programming Interface. It’s basically a documented mechanism for other applications to interact with yours in a meaningful way.

A RESTful API is a specific design principal in making an API. It makes use of HTTP as the communication interface, and has a design model around how you should write and consume it. It also has some design principles, such as being stateless.

Anonymous 0 Comments

In simple terms, a RESTful API is a way for clients to access or modify information about data on the backend, in a protected and controlled way. The data (and available operations against that data) is exposed to users in terms of “resources”.

For instance, if a backend service is holding information about user accounts, it may expose the `/users` resource through an API. Through the various verbs defined in the HTTP standard (most commonly used are GET, POST, PUT, PATCH), you can then manipulate the `/users` resource:

* `GET /api/users` – Returns the collection of all users.

* `GET /api/users/111` – Returns the user with identifier “111”.

* `POST /api/users` – Adds a new user to the collection of users.

And so on. REST is standardized this way, so that you can go to any number of RESTful APIs and understand immediately how to manipulate the backend data.