CRUD stands for Create, Read, Update, and Delete. These four operations are the foundation of many REST APIs. Postman can be used to test each CRUD operation before connecting the API to a React Native mobile application.
CRUD represents the four basic operations performed on data:
Create
Read
Update
Delete
REST APIs commonly map CRUD operations to HTTP methods.
| CRUD | HTTP Method |
|---|---|
| Create | POST |
| Read | GET |
| Update | PUT / PATCH |
| Delete | DELETE |
Suppose our API manages student records.
Student
----------------
id
name
email
course
mobile
Postman can be used to test all CRUD operations for this student data.
Suppose our API is available at:
http://localhost/api
We can store this URL in a Postman environment variable.
{{base_url}}
Suppose the student endpoint is:
{{base_url}}/students.php
This endpoint can be used for multiple CRUD operations depending on the HTTP method.
The POST method can be used to create a new student.
POST
{{base_url}}/students.php
Select Body → raw → JSON in Postman.
Send student information as JSON.
{
"name": "Rahul Kumar",
"email": "rahul@example.com",
"course": "ADCA",
"mobile": "9876543210"
}
Click Send to test the Create operation.
After sending the POST request, check the response.
A successful response may contain:
{
"success": true,
"message": "Student created successfully"
}
Also check the HTTP status code returned by the API.
The GET method can be used to retrieve all students.
GET
{{base_url}}/students.php
Click Send in Postman to test the Read operation.
The API may return an array of student records.
[
{
"id": 1,
"name": "Rahul Kumar",
"course": "ADCA"
},
{
"id": 2,
"name": "Amit Kumar",
"course": "Tally"
}
]
A single student can be retrieved using an ID.
GET
{{base_url}}/students.php?id=1
This request should return the student whose ID is 1.
Try requesting an ID that does not exist.
GET
{{base_url}}/students.php?id=99999
Check whether the API returns an appropriate status code and error message.
The PUT method can be used to update an existing student.
PUT
{{base_url}}/students.php?id=1
The request should contain the updated student data.
{
"name": "Rahul Kumar",
"email": "rahulnew@example.com",
"course": "Java Full Stack",
"mobile": "9876543210"
}
Send the request and check whether the student information was updated.
A successful update may return a response such as:
{
"success": true,
"message": "Student updated successfully"
}
Always verify the response and status code.
PATCH can be used when only part of a resource needs to be changed.
PATCH
{{base_url}}/students.php?id=1
For example, update only the course.
{
"course": "Python"
After sending a PATCH request, check whether the selected field was updated correctly.
{
"success": true,
"message": "Student updated successfully"
}
The DELETE method can be used to remove a student.
DELETE
{{base_url}}/students.php?id=1
Send the request after confirming that the API is designed to delete the specified record.
A successful DELETE operation may return:
{
"success": true,
"message": "Student deleted successfully"
}
Verify the response and then use GET to confirm the expected data state.
After testing each operation, verify the result using another request.
POST
↓
GET
↓
PUT
↓
GET
↓
DELETE
↓
GET
This helps confirm that the data changed as expected.
This sequence provides a simple end-to-end CRUD test.
CRUD testing should also include invalid data.
For example:
POST
{
"name": "",
"email": "",
"course": ""
}
Check whether the API correctly validates required fields.
If an email or another field must be unique, try creating a duplicate record.
POST
{
"name": "Rahul",
"email": "rahul@example.com",
"course": "ADCA"
}
Send the same request again and verify the API's duplicate-data behavior.
Test update and delete operations with an invalid ID.
PUT {{base_url}}/students.php?id=99999DELETE {{base_url}}/students.php?id=99999
The API should handle a missing student appropriately.
All CRUD requests can be stored in a Postman collection.
Student Management API
│
├── Create Student
├── Get Students
├── Get Student
├── Update Student
├── Patch Student
└── Delete Student
This makes it easy to test the complete API repeatedly.
It is useful to test the backend API in Postman before integrating it with the React Native application.
PHP + MySQL API
↓
Postman CRUD Testing
↓
Verify JSON Responses
↓
React Native Integration
This helps identify backend problems before mobile application development.
CREATE
POST /students
↓
READ
GET /students
↓
UPDATE
PUT /students?id=1
↓
READ
GET /students?id=1
↓
DELETE
DELETE /students?id=1
↓
READ
GET /students?id=1
After each step, check the HTTP status code and response body.
Postman can be used to test the complete CRUD lifecycle of a REST API. Create data with POST, read data with GET, update data with PUT or PATCH, and delete data with DELETE. After each operation, verify the response and the resulting data.
POST
Create
↓
GET
Read
↓
PUT / PATCH
Update
↓
DELETE
Delete
↓
Verify Result
Question: Which HTTP method is commonly used to create a new resource in a REST API?