#1 Data Analytics Program in India
₹2,499₹1,499Enroll Now
4 min read
•Question 1 of 28easy

What is a REST API?

Understanding REST architecture principles.

What You'll Learn

  • What REST is
  • Key principles
  • HTTP methods

What is REST?

REST (Representational State Transfer) is an architectural style for designing networked applications.

Key Principles

  • Stateless - each request contains all info needed
  • Client-Server separation
  • Uniform interface (HTTP methods)
  • Resource-based URLs

HTTP Methods

MethodPurpose
GETRetrieve resources
POSTCreate new resource
PUTUpdate entire resource
PATCHPartial update
DELETERemove resource

Example URLs

code.jsJavaScript
GET    /users      - Get all users
GET    /users/1    - Get user with id 1
POST   /users      - Create new user
PUT    /users/1    - Update user 1
DELETE /users/1    - Delete user 1