How to test APIs with Postman — Basic
Send GET/POST/PUT/DELETE requests with JSON bodies and headers; verify status codes and response shape.
Learn: Postman is the GUI you used throughout the program to exercise REST endpoints. Build a collection per resource with example bodies so regressions are easy to spot after refactors.
Supplementary examples
Headers for JSON APIs
Content-Type: application/json
Accept: application/json
# Optional when using cookies/sessions:
# Cookie: session=...Course example
# Example workflow (Postman UI):
# 1. Method: POST URL: http://localhost:5001/users
# 2. Body (raw JSON): { "username": "demo_user" }
# 3. Expect: 201 + JSON body with created user
# 4. Follow-up GET http://localhost:5001/users to list all
Additional references & examples
- Postman documentation
Send HTTP requests, save collections, and inspect responses.
- HTTP status codes (MDN)
When to use 200, 201, 204, 400, 404, 500, and related codes.