REST API Tutorial
🚀 Introduction
REST APIs allow different applications to communicate with each other.
Each API request uses a specific HTTP Method based on the action:
| Method | Action | Meaning |
|---|---|---|
| GET | Read | Fetch data from server |
| POST | Create | Add new data |
| PUT | Update | Replace existing data |
| PATCH | Modify | Modify part of existing data |
| DELETE | Remove | Delete data |
We will use live working APIs from:
👉 https://restful-api.dev/
📥 1. GET — Retrieve / Read Data
➤ Example 1: Fetch multiple items using IDs
🔗 API URL:
➤ Example 2: Fetch a specific object by ID
🔗 API URL:
✅ GET only retrieves data, it never modifies.
➕ 2. POST — Create Data
📌 Used when you want to add a new record into server/database.
🔗 API URL:
📦 Request Body:
🟦 cURL Example (POST)
✅ POST creates a new record and server generates an ID.
🔄 3. PUT — Update (Replace everything)
📌 Used to replace the entire object with new values.
🔗 API URL:
📦 Request Body (full update):
✏ 4. PATCH — Update (Partial)
📌 Used when you want to update only one field, not the entire object.
🔗 API URL:
📦 Request Body (only updating name):
✅ PATCH updates only the provided field, keeping the rest unchanged.
🗑️5. DELETE — Remove Data
📌 Used to delete a record from server/database.
🔗 API URL:
⬅️ After DELETE, fetching the same ID will return not found.
🎯 Summary: When to use what?
| Method | CRUD Action | Usage |
|---|---|---|
| GET | Read | Fetch existing data |
| POST | Create | Insert new record |
| PUT | Update | Replace full object |
| PATCH | Update | Modify some fields |
| DELETE | Delete | Remove object |
🎉 Final Notes
These APIs are great for practice using:
-
Postman
-
Swagger
-
Java / Python / JavaScript API projects
You can now confidently use REST API methods in your applications.
💼 Professional Support Available
If you are facing issues in real projects related to enterprise backend development or workflow automation, I provide paid consulting, production debugging, project support, and focused trainings.
Technologies covered include Java, Spring Boot, PL/SQL, Azure, and workflow automation (jBPM, Camunda BPM, RHPAM).
📧 Contact: ishikhanirankari@gmail.com | info@realtechnologiesindia.com
🌐 Website: IT Trainings | Digital metal podium
Comments
Post a Comment