Get ready for your next interview with our comprehensive question library
REST (Representational State Transfer) is an architectural style for designing networked applications. The core principles are:
REST uses resources identified by URIs and standard HTTP methods to perform operations.
A RESTful API follows these characteristics:
/users/123
)Example of RESTful endpoints:
GET /users # Get all users
GET /users/123 # Get specific user
POST /users # Create new user
PUT /users/123 # Update user
DELETE /users/123 # Delete user
Resources are the key abstraction in REST. A resource is any information that can be named and addressed. Resources should be:
/users
not /getUsers
/users/123/orders/456
/users
, not /user
)Resources represent entities in your domain model and should map to business objects or data entities.
POST:
POST /users
creates a new userPUT:
PUT /users/123
creates or updates user with ID 1232xx Success:
4xx Client Error:
5xx Server Error:
Authentication: Verifies who the user is (identity verification)
Authorization: Determines what the authenticated user can do (permission checking)
Both are typically required for secure APIs. Authentication happens first, then authorization checks permissions.
Upgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumUpgrade to Premium to see the answer
Upgrade to PremiumAccess all premium content - interview questions, and other learning resources
We regularly update our features and content, to ensure you get the most relevant and updated premium content.
1000 monthly credits
Cancel anytime