Skip to main content

Getting Started with Postman

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

  1. Open Postman and click New → HTTP Request
  2. Set the method to GET
  3. Enter the URL: https://jsonplaceholder.typicode.com/posts/1
  4. 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:

  1. Click Collections in the sidebar
  2. Click + New Collection
  3. Name it "JSONPlaceholder API"
  4. 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 user

Environments

Environments let you switch between different servers (dev, staging, production) without changing your requests.

Creating an environment:

  1. Click Environments in the sidebar
  2. Click + New Environment
  3. Name it "Development"
  4. Add a variable:
    • Variable: base_url
    • Value: https://jsonplaceholder.typicode.com

Using environment variables: Replace hardcoded URLs in your requests:

Before: https://jsonplaceholder.typicode.com/posts
After:  {{base_url}}/posts

Now you can switch to a "Staging" environment with a different base_url and all your requests update automatically.

Variables

Postman supports multiple variable scopes:

ScopeLifetimeUse Case
GlobalAvailable everywhereAPI keys shared across collections
EnvironmentPer environmentBase URLs, server-specific values
CollectionPer collectionAuth tokens for a specific API
LocalCurrent request onlyTemporary values during execution

Variable syntax: {{variable_name}}

Sending POST Requests

To create a resource:

  1. Set method to POST
  2. Enter URL: {{base_url}}/posts
  3. Go to Body tab
  4. Select raw and JSON
  5. Enter:
{
  "title": "My Test Post",
  "body": "This is a test.",
  "userId": 1
}
  1. Click Send
  2. Verify the response is 201 Created with 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