0
0
Postmantesting~3 mins

Why Send request block in Postman? - Purpose & Use Cases

Choose your learning style9 modes available
The Big Idea

What if you could test APIs with one click and never worry about mistakes again?

The Scenario

Imagine you need to test an API by sending the same request over and over manually through a browser or command line.

You have to copy the URL, add headers, set the body, and hit send each time.

The Problem

This manual way is slow and boring.

You might forget to add headers or use wrong data.

It's easy to make mistakes and hard to repeat exactly the same test.

The Solution

Using a send request block in Postman lets you save all request details once.

Then you just run it anytime with one click or automatically in a test script.

This saves time, avoids errors, and makes testing consistent.

Before vs After
Before
curl -X POST http://api.example.com/data -H 'Content-Type: application/json' -d '{"name":"test"}'
After
pm.sendRequest({url: 'http://api.example.com/data', method: 'POST', header: [{key: 'Content-Type', value: 'application/json'}], body: {mode: 'raw', raw: '{"name":"test"}'}}, function (err, res) { console.log(res.json()); });
What It Enables

It enables automated, repeatable, and error-free API testing with ease.

Real Life Example

A tester needs to check if a user registration API works correctly after every code change.

Using send request blocks, they run the same request automatically in a test suite instead of typing it manually each time.

Key Takeaways

Manual API testing is slow and error-prone.

Send request blocks save request details for easy reuse.

This makes testing faster, consistent, and less stressful.