Answer
Params vs Body in Postman
Params Tab
The Params tab adds query parameters to the URL. These appear after ? in the URL.
CODE
URL: https://api.example.com/users?page=2&limit=10
When to use:
- ✓GET requests to filter, sort, or paginate results
- ✓Any method where data is passed via URL
- ✓Search parameters
Example:
CODE
Key | Value
page | 2
limit | 10
▸Result:
GET /api/users?page=2&limit=10✦
Body Tab
The Body tab sends data in the HTTP request body. Used for POST, PUT, PATCH requests to create or update resources.
Body Types in Postman:
| Type | Use Case |
|---|---|
| none | No body (GET/DELETE) |
| form-data | File uploads, mixed data |
| x-www-form-urlencoded | HTML form submission |
| raw | JSON, XML, plain text |
| binary | Upload files directly |
| GraphQL | GraphQL queries |
Raw JSON Example:
JSON
{
"name": "John Doe",
"email": "john@example.com",
"job": "QA Engineer"
}
✦
Quick Comparison
| Feature | Params | Body |
|---|---|---|
| Location | URL (?key=value) | Request body |
| Methods | GET (mainly) | POST, PUT, PATCH |
| Visibility | Visible in URL | Not in URL |
| Data type | Simple key-value | Complex JSON/XML/Form |
| Used for | Filtering/searching | Creating/updating data |
Rule of Thumb
- ✓Params = What you WANT (filter criteria)
- ✓Body = What you SEND (resource data)
