Postman is the most popular tool for API testing. It lets you send requests, inspect responses, write assertions, and automate test suites — all without writing a single line of backend code.
Installing Postman
Download Postman from postman.com. It's available for Windows, macOS, and Linux. There's also a web version, but the desktop app is recommended for full functionality.
Your First Request
- Open Postman and click New → HTTP Request
- Set the method to GET
- Enter the URL:
https://jsonplaceholder.typicode.com/posts/1 - Click Send
You should see a JSON response:
{
"userId": 1,
"id": 1,
"title": "sunt aut facere repellat provident occaecati...",
"body": "quia et suscipit\nsuscipit recusandae..."
}Congratulations — you just tested an API!
Understanding the Postman Interface
Request Area
- Method selector: GET, POST, PUT, PATCH, DELETE
- URL bar: Where you enter the endpoint
- Params tab: Add query parameters
- Headers tab: Add custom headers
- Body tab: Send JSON, form data, or raw text
- Auth tab: Configure authentication
Response Area
- Body: The response data (JSON, HTML, XML)
- Headers: Response headers from the server
- Status: HTTP status code and time
- Size: Response size in bytes
Collections
Collections are folders that organize related requests. Think of them as test suites.
Creating a collection:
- Click Collections in the sidebar
- Click + New Collection
- Name it "JSONPlaceholder API"
- Add requests by clicking Add Request
Example collection structure:
📁 JSONPlaceholder API
📁 Posts
GET List all posts
GET Get single post
POST Create post
PUT Update post
DELETE Delete post
📁 Users
GET List all users
GET Get single userEnvironments
Environments let you switch between different servers (dev, staging, production) without changing your requests.
Creating an environment:
- Click Environments in the sidebar
- Click + New Environment
- Name it "Development"
- Add a variable:
- Variable:
base_url - Value:
https://jsonplaceholder.typicode.com
- Variable:
Using environment variables: Replace hardcoded URLs in your requests:
Before: https://jsonplaceholder.typicode.com/posts
After: {{base_url}}/postsNow you can switch to a "Staging" environment with a different base_url and all your requests update automatically.
Variables
Postman supports multiple variable scopes:
| Scope | Lifetime | Use Case |
|---|---|---|
| Global | Available everywhere | API keys shared across collections |
| Environment | Per environment | Base URLs, server-specific values |
| Collection | Per collection | Auth tokens for a specific API |
| Local | Current request only | Temporary values during execution |
Variable syntax: {{variable_name}}
Sending POST Requests
To create a resource:
- Set method to POST
- Enter URL:
{{base_url}}/posts - Go to Body tab
- Select raw and JSON
- Enter:
{
"title": "My Test Post",
"body": "This is a test.",
"userId": 1
}- Click Send
- Verify the response is
201 Createdwith the new resource
Importing and Exporting
Collections can be shared with your team:
- Export: Right-click a collection → Export → Save as JSON
- Import: Click Import → Upload the JSON file
- Share: Use Postman workspaces for real-time collaboration