API Testing
REST API
An architectural style for web APIs using HTTP methods (GET, POST, PUT, DELETE) to manage resources.
Full definition
REST (Representational State Transfer) is the most common architectural style for web APIs. RESTful APIs use standard HTTP methods to perform operations on resources identified by URLs.
REST principles:
- Stateless: Each request contains all information needed — no server-side session
- Resource-based: URLs represent resources (e.g., /users, /orders/123)
- HTTP methods as verbs: GET (read), POST (create), PUT (update), DELETE (remove)
- JSON responses: Most common response format
Common REST patterns:
- GET /users → List all users
- GET /users/123 → Get user 123
- POST /users → Create a new user
- PUT /users/123 → Update user 123
- DELETE /users/123 → Delete user 123
HTTP status codes:
- 2xx: Success (200 OK, 201 Created, 204 No Content)
- 3xx: Redirect
- 4xx: Client error (400 Bad Request, 401 Unauthorized, 404 Not Found)
- 5xx: Server error (500 Internal Server Error)
As a QA engineer, understanding REST is essential for API testing, debugging, and writing integration tests.