Bytes
rocket

Your Success, Our Mission!

6000+ Careers Transformed.

Introduction to PUT Method

Last Updated: 4th September, 2026

Think of the PUT method like editing a saved contact in your phone.
When you update the name or number, the old data is replaced with new data.

That’s exactly what PUT does in web development.

Definition:
The PUT HTTP method is used to update an existing resource completely on the server.

kumud kuku (1).png

Characteristics of PUT

  • Idempotent → Calling it multiple times gives the same result
  • Full Update → Replaces the entire resource
  • Client Sends Complete Data → Not partial (unlike PATCH)

Simple Understanding

Action

Method

Create new dataPOST
Read dataGET
Update full dataPUT
Delete dataDELETE

Code / Tabular Example

Node.js (Express) Example

const express = require('express');
const app = express();

app.use(express.json());

let users = [
{ id: 1, name: "Taniya", age: 20 }
];

// PUT method
app.put('/users/:id', (req, res) => {
 const id = parseInt(req.params.id);
 const { name, age } = req.body;

 const user = users.find(u => u.id === id);

 if (!user) {
  return res.status(404).send("User not found");
}

 // Replacing entire data
user.name = name;
user.age = age;

res.send({
  message: "User updated successfully",
  updatedUser: user
});
});

app.listen(3000);

Technical Example

Request

PUT /users/1
Content-Type: application/json

{
 "name""Taniya Sharma",
 "age"21
}

Response

200 OK
User updated successfully

Technical Insight

  • PUT follows idempotency:
PUT /users/1 (same data multiple times)
→ Result remains same

 
  • If resource doesn’t exist:
    • Some APIs create it (upsert behavior)
    • Some return 404 Not Found
Module 1: Introduction to PUT MethodIntroduction to PUT Method

Top Tutorials

Logo

Top 10 Machine Learning Projects with Source Code (Beginner to Advanced)

Explore the Top 10 Machine Learning projects with source code, from beginner to advanced. Learn real-world ML applications, build portfolio-ready projects, and master hands-on skills with step-by-step tutorials from AlmaBetter.

3 Modules10 Lessons1151 Learners
Start Learning
Logo
Careers in Tech

Technologies to Learn in 2026: Building the Future of Innovation

Explore the top technologies to learn in 2026 including Generative AI, Cloud, Cybersecurity, Web3, Data Science, AR/VR, Quantum, RPA, and Green Tech.

00 Lessons909 Learners
Start Learning
Logo
Careers in Tech

aws

This tutorial presents a structured, beginner-focused yet industry-aligned guide to Amazon Web Services, designed specifically for 2026 learning and career requirements

00 Lessons42 Learners
Start Learning
  • Official Address
  • 4th floor, 133/2, Janardhan Towers, Residency Road, Bengaluru, Karnataka, 560025
  • Communication Address
  • Follow Us
  • facebook
    instagram
    linkedin
    twitter
    youtube
    telegram

© 2026 AlmaBetter