Before testing REST APIs, we need to install Postman on our computer. Postman provides a graphical interface where we can create API requests, send them to a server, and inspect the responses.
In this lesson, we will learn the basic installation process and prepare Postman for testing our PHP REST APIs.
Postman installation means installing the Postman application on your computer so that you can create and test HTTP requests.
Install Postman
↓
Open Postman
↓
Create API Request
↓
Send Request
↓
Check Response
We need Postman because it allows us to test the backend API independently from our mobile application.
In this course, we will use Postman to test the REST APIs that we build using PHP and MySQL.
PHP
↓
REST API
↓
Postman
↓
Test Request
↓
Check Response
After the API works correctly, we will connect it to React Native.
Postman is available for commonly used desktop operating systems. The installation process may vary slightly depending on the operating system.
In this tutorial, we will focus mainly on using Postman on a desktop computer.
To install Postman, download the installer from the official Postman website.
Choose the installer appropriate for your operating system and computer architecture.
After downloading the installer, locate the downloaded setup file.
On Windows, the downloaded Postman installer can be opened to begin the installation process.
The setup process generally installs the Postman desktop application on the computer.
Downloaded Installer
↓
Open Installer
↓
Installation
↓
Postman Application
After opening the installer, follow the installation instructions shown by the operating system.
Allow the installation process to complete before launching the application.
The exact screens can vary depending on the Postman version and operating system.
After the installation finishes, Postman can be launched from the installed application.
Installation Complete
↓
Open Postman
↓
Postman Workspace
You are now ready to begin creating API requests.
Launch Postman from the Start menu, desktop shortcut, application launcher, or another location where your operating system provides installed applications.
After Postman starts, you will see the Postman application interface.
A Postman workspace is where you organize and work with API requests, collections, environments, and related API development resources.
Workspace
├── Requests
├── Collections
├── Environments
└── API Tests
Depending on the current Postman setup and features you want to use, Postman may provide options for signing in or creating an account.
For learning basic API requests, focus first on understanding the request and response workflow.
If you choose to sign in, follow the authentication process presented by Postman.
After successful sign-in, you can work with the available Postman workspace features.
Keep account credentials private and do not share passwords or authentication tokens.
Installing Postman does not require you to immediately create your own API.
However, to test a real API, you need an API endpoint that can receive your request.
Postman
↓
API URL
↓
Server
↓
Response
During this course, we will eventually test APIs running on a local PHP development environment.
For example, a local API might have a URL similar to:
http://localhost/rest_api/api/students.php
The exact URL depends on the folder structure and local server configuration.
Postman can send requests to a locally running API using a localhost URL.
Postman
↓
http://localhost/...
↓
Local PHP Server
↓
PHP REST API
This is useful when developing an API before publishing it to a production server.
Before testing a local PHP REST API, make sure your local web server is running.
Depending on your development environment, you may use software such as a local Apache/PHP stack.
Local Server
↓
PHP
↓
REST API
↓
MySQL
After opening Postman, verify that the application loads correctly and that you can create a new request.
A basic test is to create a request and enter an API URL.
Method: GET
URL:
https://example.com
The exact response depends on the server you contact.
After installing Postman, create a new HTTP request.
For the first simple request, select the GET method.
GET
https://example.com
GET is commonly used to retrieve information from a server.
After entering the request URL, click the Send button.
Select GET
↓
Enter URL
↓
Click Send
↓
Server Processes Request
↓
Response Appears
After sending the request, Postman displays the response returned by the server.
Important information includes:
Postman is especially useful for REST APIs that exchange JSON data.
For example, an API may return:
{
"success": true,
"message": "API is working"
}
Postman displays the JSON response so you can inspect its structure.
After installation, you can use the Headers section to configure headers required by an API.
Content-Type: application/json
Accept: application/json
Authentication headers can also be added when an API requires them.
Postman can send request bodies for methods such as POST, PUT and PATCH.
Example JSON body:
{
"name": "Rahul",
"course": "React Native"
}
This will be useful when we start creating our PHP CRUD APIs.
If Postman does not start correctly, check basic installation and system requirements first.
Postman becomes especially useful once we start building our PHP REST API.
PHP API
↓
Test in Postman
↓
Verify JSON
↓
Verify Status Code
↓
Fix Problems
↓
Connect React Native
After installing Postman, use this checklist:
Download Postman
↓
Install Postman
↓
Open Postman
↓
Create Workspace / Request
↓
Select HTTP Method
↓
Enter API URL
↓
Send Request
↓
Check Response
After installing Postman, you should be ready to create your first real API request.
In the next lesson, we will create and send a basic request using Postman.
Postman
↓
New Request
↓
GET
↓
API URL
↓
Send
Postman installation is the first step toward using Postman for REST API development. Once Postman is installed and opened, we can create requests and communicate with our PHP REST API.
Postman
↓
HTTP Request
↓
PHP REST API
↓
MySQL
↓
JSON Response
↓
Postman
In the next lesson, we will learn how to create our first Postman request and send it to an API.
Question: What is the main purpose of installing Postman in this REST API course?