</>

Technology

Postman

Difficulty

Beginner

Interview Question

How do you add query parameters in Postman?

Answer

Adding Query Parameters in Postman

Method 1: Using the Params Tab (Recommended)

  1. āœ“Enter your base URL: https://reqres.in/api/users
  2. āœ“Click the Params tab below the URL bar
  3. āœ“Add key-value pairs:
    KeyValue
    page2
    per_page5
  4. āœ“Postman automatically appends them to the URL:
    CODE
    https://reqres.in/api/users?page=2&per_page=5
    
  5. āœ“Click Send

Method 2: Type Directly in URL

You can also type query params directly in the URL:

CODE
https://reqres.in/api/users?page=2&per_page=5

Postman will parse and display them in the Params tab automatically.

Method 3: Using Environment Variables

CODE
https://reqres.in/api/users?page={{pageNumber}}

Set pageNumber as an environment variable with value 2.

Enabling/Disabling Parameters

Each param has a checkbox — uncheck it to temporarily disable without deleting:

CODE
ā˜‘ page      2
☐ per_page  5    ← disabled, not sent

Example Test After Adding Params

JavaScript
pm.test("Page number is 2", function () {
    const jsonData = pm.response.json();
    pm.expect(jsonData.page).to.eql(2);
});

Tips

  • āœ“Use Bulk Edit mode to paste many params at once
  • āœ“Query params with special characters are automatically URL-encoded by Postman
  • āœ“Params can be linked to collection or environment variables for dynamic testing

Follow AutomateQA

Related Topics