APIs power most of the apps we use every day, from logging in with Google to checking the weather or ordering food online. But for beginners, APIs can feel like a mysterious black box.
That's where API testing tools come in. They let you explore, send requests, and understand responses without diving into complex code. Two of the most popular tools today are Postman and the newer HTTPie.
In this guide, you'll learn how to make your first API call with both tools, see how they compare, and decide which one is right for you.
What is an API, and Why Does It Matter?
API (Application Programming Interface) is like a waiter at a restaurant.
You (the user) ask for something. The waiter (API) takes your order to the kitchen (server). The kitchen prepares it, and the waiter brings it back.
Everyday examples:
- Google Maps API -> shows maps inside apps.
- Payment APIs -> enable online transactions.
- Weather APIs -> power weather widgets.
Learning APIs helps you unlock a huge part of software development.
Example 1: A Weather App Request
Your weather app calls an API like this:
Request:
GET https://api.weather.com/today?city=London
Response (JSON):
{
"city": "London",
"temperature": 21,
"condition": "Sunny"
}
What happens in the app: The app reads the response and shows -> "21°C, Sunny in London."
Example 2: A Payment API Request
When you pay online, the app might call a Payment API:
Request:
POST https://api.payments.com/checkout
Body:
{
"amount": 1000,
"currency": "USD",
"method": "credit_card",
"cardNumber": "**** **** **** 1234"
}
Response (JSON):
{
"transactionId": "TXN2025001",
"status": "success",
"amount": 1000
}
What happens in the app: The app confirms -> "Payment successful. Transaction ID: TXN2025001."
These examples show how APIs connect requests from apps to data and actions on servers.
What is Postman?
Postman is a popular tool for sending API requests and viewing responses without writing code.
- Beginner-friendly interface.
- Works on Windows, Mac, Linux, or in your browser.
- Used by students, developers, and companies worldwide.
Instead of jumping straight into code, you can explore APIs visually.
Getting Started with Postman
Install Postman -> Download here or use the Web version. Sign up / log in -> Create a free account. Explore the interface:
- Left side -> Workspace & Collections.
- Center -> Request builder (method + URL).
- Bottom -> Response panel (data from API).
Press enter or click to view image in full size
Making Your First API Call with Postman
Let's use the Dog CEO API 🐶, which gives random dog images.
Steps:
- Open Postman -> New Request.
- Select method -> GET.
- Paste this URL:
https://dog.ceo/api/breeds/image/random - Click Send.
You should see a JSON response with a random dog image link.
Press enter or click to view image in full size
Understanding the Response
When you hit Send, Postman shows:
- Status code (e.g., 200 OK = success, 404 = not found, 500 = server error).
- Response body (usually in JSON format).
Example JSON:
{
"message": "https://images.dog.ceo/breeds/spaniel-blenheim/n02086646_1663.jpg",
"status": "success"
}
message contains the image link. status tells us the request worked.
Going Beyond GET
GET requests only fetch data. Let's try POST (send data).
Become a Medium member
Using JSONPlaceholder (a fake API for testing):
- Set method -> POST.
- URL:
https://jsonplaceholder.typicode.com/posts - In Body -> raw -> JSON, enter:
{
"title": "My First API Post",
"body": "Learning APIs with Postman!",
"userId": 1
}
- Hit Send -> You'll see a response with your new post (with an id assigned).
Press enter or click to view image in full size
Meet HTTPie - The New Kid on the Block
HTTPie is a modern API testing tool built to be simpler, cleaner, and more flexible.
- Works in the Browser, Desktop, and Terminal.
- Minimal, distraction-free interface.
- Built-in AI assistant that helps generate API requests in plain English.
- Open source with a growing developer community.
Getting Started with HTTPie
Install HTTPie -> Download here or use the Web version. No account is required, but signing up lets you save workspaces. Explore the interface:
- Top bar -> Method + URL.
- Middle -> Request builder & body.
- Bottom -> Response panel (JSON results).
Making Your First API Call with HTTPie
We'll use the same Dog CEO API for fairness.
Steps:
- Open HTTPie (desktop, web, or terminal).
- Select method -> GET.
- Paste this URL:
https://dog.ceo/api/breeds/image/random - Click Send.
You'll see a JSON response with a random dog image link, just like Postman.
Understanding the Response in HTTPie
Just like in Postman, HTTPie shows:
- Status code (200 OK, 404 not found, etc.).
- Response body (JSON format).
Example JSON:
{
"message": "https://images.dog.ceo/breeds/spaniel-blenheim/n02086646_1663.jpg",
"status": "success"
}
message contains the image link. status confirms the request succeeded.
Going Beyond GET in HTTPie
Let's try the same POST request using JSONPlaceholder.
- Method -> POST
- URL:
https://jsonplaceholder.typicode.com/posts - In Body -> raw -> JSON, enter:
{
"title": "My First API Post",
"body": "Learning APIs with HTTPie!",
"userId": 1
}
- Hit Send -> You'll see a response with your new post, including an id.
If you're using HTTPie in the terminal, the same request looks like:
http POST https://jsonplaceholder.typicode.com/posts title="My First API Post" body="Learning APIs with HTTPie!" userId=1
Postman vs HTTPie - Pros & Cons
Wrap-Up: Which Should You Use?
If you're a beginner just learning APIs -> Postman is a great starting point. It's stable, trusted, and widely used. If you're curious about modern tools or enjoy working in the terminal, HTTPie is a lightweight, sleek tool that comes with AI-powered help.
Real-Life Applications of APIs
Web & Mobile Apps -> APIs fetch data, such as news feeds or user profiles. Automation -> APIs connect systems (e.g., Slack bots, CRMs). Integrations -> APIs allow apps like Zoom, Google Calendar, or Stripe to work together.
APIs are the building blocks of modern apps. Whether you use Postman or HTTPie, the important step is to start experimenting - and you've just taken it.
References & Further Reading
- Postman Learning Center
- HTTPie Documentation
- Dog CEO API
- JSONPlaceholder
