Testing REST APIs with Postman (Part 1)
Postman is a popular tool for sending HTTP requests and inspecting responses. This post (Part 1) covers the basics: creating requests, setting method and URL, adding headers and body, and checking status and response for manual API testing.
Getting started
- Install Postman (desktop or web). Create a workspace and optionally a collection for your project.
- A request has: method (GET, POST, etc.), URL, headers, and optionally body.
- Send the request and inspect the response: status, headers, body (pretty-printed JSON or raw).
Creating a request
- Method and URL: Choose GET, POST, PUT, PATCH, or DELETE; enter the full URL (e.g.
https://api.example.com/users). - Headers: Add
Content-Type: application/jsonfor JSON body; addAuthorization: Bearer <token>when the API requires auth. - Body: For POST/PUT/PATCH, select "raw" and "JSON", then type or paste the request body.
Send the request and verify status code and response body.
Organizing and reusing
- Collections: Group requests by feature or resource (e.g. "Users", "Orders").
- Variables: Use collection or environment variables for base URL, token, or IDs so you can switch environments (e.g. dev, staging) without editing each request.
Part 2 covers assertions, scripts, and running collections for automated checks.
Summary
- Postman = create requests (method, URL, headers, body) and inspect responses.
- Use collections and variables to organize and reuse; add auth and Content-Type as needed.
- Part 2 adds assertions and automation (tests and collection runner).