What makes an API "RESTful" versus just being an HTTP-based API?
Last updated
An HTTP API just uses HTTP as a transport pipe. A RESTful API uses HTTP's semantics and honors REST's constraints (stateless, cacheable, uniform interface, layered).
RESTful means noun-based URLs (
/users/1, not/getUser) and verbs used per their safety and idempotency semantics.It returns meaningful status codes (
201,404,409) instead of always200with errors in the body.
- https://developer.mozilla.org/en-US/docs/Glossary/HTTP
- https://developer.mozilla.org/en-US/docs/Glossary/REST
- https://www.greatfrontend.com/blog/tags/javascript
- https://www.greatfrontend.com/pt-BR/blog/series/beginner-interview-questions
- https://www.freecodecamp.org/news/build-consume-and-document-a-rest-api/