API Fundamentals
/Intermediate
PUT
Definition
An HTTP method used to UPDATE an existing resource by completely replacing it with the new data provided in the request payload.
Explain Like I'm New
If you use PUT to update a user's name, you must send their name, their email, their age, and their phone number. PUT takes the entire old record, throws it in the trash, and replaces it with the brand new record you just sent.
Real World Example
Updating a user's entire profile settings page. When they click 'Save', the frontend sends every single setting (even the ones they didn't change) to completely overwrite the database row.
Common Use Cases
- •Full resource replacements
Interactive Example
Loading...
Console output will appear here...
Interview Questions
basic
- What is the main difference between PUT and POST?
intermediate
- Is a PUT request Idempotent?