Interview question
What is REST and what makes an API RESTful? REST क्या है और किसी API को RESTful क्या बनाता है?
Answer
REST (Representational State Transfer) is an architectural style for designing networked applications using stateless, resource-based communication over HTTP.
| REST Principle | Meaning |
|---|---|
| Statelessness | Each request contains all info needed; server stores no client session |
| Resource-based | URLs represent resources (nouns), not actions (e.g. /users not /getUsers) |
| Uniform interface | Standard HTTP methods (GET, POST, PUT, DELETE) map to operations |
| Client-server separation | Frontend and backend evolve independently |
An API is 'RESTful' when it follows these conventions consistently, using proper HTTP methods and status codes rather than custom action-based endpoints.
REST एक architectural style है जो stateless, resource-based communication HTTP पर design करने के लिए इस्तेमाल होता है।
| REST Principle | अर्थ |
|---|---|
| Statelessness | हर request में पूरी जानकारी होती है, server session नहीं रखता |
| Resource-based | URLs resources represent करते हैं (जैसे /users) |
| Uniform interface | GET, POST, PUT, DELETE जैसे standard HTTP methods |
Was this answer clear?