Postman Overview
Postman is a collaboration platform for API development. It simplifies each step of building an API and streamlines collaboration so you can create better APIs faster.
Key Features
- API Client: Send REST, SOAP, and GraphQL requests
- Collections: Organize and save API requests
- Environments: Manage variables for different setups
- Automated Testing: Write and run API tests
- Mock Servers: Simulate API endpoints
- Documentation: Generate and publish API docs
- Monitoring: Schedule API health checks
Common Use Cases
API Development
Design, build, and test APIs in a collaborative environment.
API Testing
Create automated tests for API endpoints.
Documentation
Generate beautiful, interactive API documentation.
Team Collaboration
Share collections and work together on APIs.
Example Request
// Example Postman request in JavaScript
pm.test("Status code is 200", function() {
pm.response.to.have.status(200);
});
pm.test("Response time is less than 200ms", function() {
pm.expect(pm.response.responseTime).to.be.below(200);
});
pm.test("Response has required fields", function() {
const jsonData = pm.response.json();
pm.expect(jsonData).to.have.property('id');
pm.expect(jsonData).to.have.property('name');
pm.expect(jsonData).to.have.property('email');
});
// Environment variables example
const apiKey = pm.environment.get("API_KEY");
pm.sendRequest({
url: 'https://api.example.com/data',
method: 'GET',
header: {
'Authorization': `Bearer ${apiKey}`
}
}, function(err, res) {
console.log(res.json());
});