veda.ng

A REST API is a way for two computer systems to communicate over the internet using standard HTTP methods. REST stands for Representational State Transfer, and it defines a set of rules for how clients request data from servers and how servers respond. When a mobile app loads your profile from a backend, or when a payment service checks a transaction status, a REST API is usually handling that exchange. The idea is simple: every piece of data lives at a specific URL, and you interact with it using standard HTTP verbs.

The core verbs are GET (read data), POST (create new data), PUT (update existing data), and DELETE (remove data). A REST API for a blog might work like this: GET /posts returns all blog posts, GET /posts/42 returns post number 42, POST /posts creates a new post, PUT /posts/42 updates it, and DELETE /posts/42 removes it. Each request is independent and contains everything the server needs to process it. The server does not remember previous requests from the same client, which is called being stateless.

Responses come with HTTP status codes that tell the client what happened. 200 means success, 201 means a resource was created, 400 means the client sent a bad request, 401 means authentication is required, 404 means the resource was not found, and 500 means the server had an internal error. Data is usually formatted as JSON, though XML and other formats are possible.

REST became popular because it is built on top of HTTP, which every web browser and server already understands. There is no special software to install. Any programming language can make HTTP requests. APIs are easy to test with tools like curl or Postman. REST APIs are cacheable by default, which improves performance. The tradeoff is that REST can be chatty for complex data needs, requiring multiple round trips to fetch related resources. GraphQL was created to address this specific problem, but REST remains the most widely used API style on the web today.

Related Terms