REST API Testing Basics
Practical basics for testing REST APIs: methods, status codes, and structuring assertions.
API Test Lab5 min read
REST APIs use HTTP methods and predictable URLs. Testing them means sending real requests and comparing responses to expectations.
Methods and expectations
| Method | Typical success | Common checks |
|---|---|---|
| GET | 200 | Body shape, caching headers |
| POST | 201 | Location header, created id |
| DELETE | 204 or 200 | Resource removed |
Assertions that pay off
- Status code matches the contract.
- JSON schema or required fields exist.
- Latency stays within your SLO for key routes.
Keep tests small, readable, and owned by the same team that ships the API.