Postman Tutorial
- 1. Introduction to Postman
- 2. Sending Requests & Body Types
- 3. Environments & Variable Scopes
- 4. Collections & Folders
- 5. Writing API Tests & Assertions
- 6. Automated Collection Runner
- 7. Postman CLI: Newman
- 8. Integration with CI/CD Pipelines
- 9. Mock Servers
- 10. API Monitoring & Uptime Alerting
- 11. Collaborative Workspaces
- 12. Generating API Documentation
- 13. Designing APIs (OpenAPI / Swagger)
- 14. Advanced Authorization
- 15. Postman Flows & Best Practices
2. Sending Requests & Body Types
The core action inside Postman is constructing and sending HTTP requests to API servers. An HTTP request consists of a **Method**, a **URL (Endpoint)**, **Headers**, and optionally a **Body (Payload)**.
HTTP Methods Supported by Postman
Postman provides a dropdown list matching all valid HTTP request verbs. The most common are:
GET: Retrieve data from a server (e.g. fetching a list of users). Does not have a request body.POST: Send data to a server to create a new resource (e.g. creating a new user profile).PUT: Replace an existing resource entirely with new details.PATCH: Apply partial updates to an existing resource.DELETE: Remove a resource from the server.
Request Parameters & Headers
When building requests, Postman segments them into easy-to-use tabs:
- Params (Query Parameters): Key-value pairs appended to the end of a URL after a question mark (e.g.,
https://api.com/users?status=active&page=2). Postman breaks these down into a visual grid for easy editing. - Headers: Custom metadata passed along with the request. Crucial headers include:
Content-Type: Instructs the server what format the payload is in (e.g.,application/json).Authorization: Holds secure tokens or keys to prove identity.Accept: Tells the server what format the client wants back.
Mastering Request Body Types
When sending data via POST, PUT, or PATCH, you choose how that payload is formatted under the **Body** tab:
| Body Type | How it works | Common Use Case |
|---|---|---|
| none | No payload is sent. Standard for GET and DELETE requests. | Retrieving list records. |
| form-data | Sends key-value pairs. Supports uploading physical files (binary) as values. | Uploading profile images, documents, or mixed text and files. |
| x-www-form-urlencoded | Encodes values into an URL-like format (e.g., `name=John&age=30`). Doesn't support files. | Standard web forms and OAuth authorization token exchanges. |
| raw | Plain text payload. You select the formatting standard: JSON, XML, HTML, Javascript, or Plain Text. | Sending JSON objects (e.g. `{"id": 1, "title": "Postman"}`) to REST APIs. (Most Popular) |
| binary | Sends a single file raw without key headers. Useful for pure file streaming. | Direct image or PDF processing endpoints. |
Step-by-Step: Sending your First Request
Let’s execute an HTTP GET request against a public test API:
- Open Postman, click the + button to open a new tab.
- Select the method as
GETin the dropdown. - Paste this test URL:
https://jsonplaceholder.typicode.com/posts/1 - Click the blue Send button.
- Observe the response pane below: You will see a `200 OK` status, latency time in milliseconds, and the corresponding JSON payload containing a mock post object!
Pro Tip: When using the **raw** body type with **JSON** format, Postman automatically appends the
Content-Type: application/json header to your request behind the scenes, saving you manual configuration time!