Backend

REST API

An architectural style for building web APIs that uses HTTP methods (GET, POST, PUT, DELETE) to perform CRUD operations on resources identified by URLs.

REST (Representational State Transfer) is an architectural style for designing web APIs. RESTful APIs use standard HTTP methods to perform operations on resources, making them intuitive and widely compatible.

Core principles include statelessness (each request contains all necessary information), uniform interface (consistent URL patterns and HTTP methods), resource-based (everything is a resource with a unique URL), and representation (resources can be represented in JSON, XML, etc.).

Standard HTTP method mapping: GET (read), POST (create), PUT/PATCH (update), DELETE (remove). Status codes communicate results: 200 (OK), 201 (Created), 400 (Bad Request), 401 (Unauthorized), 404 (Not Found), 500 (Server Error).

REST API design best practices include using plural nouns for resources (/users, /posts), nesting for relationships (/users/123/posts), pagination for large collections, versioning (v1/users), and HATEOAS (including links to related resources in responses).

Want to learn more?

Explore more developer terms or read in-depth articles on the blog.

Browse all terms