Difference between PUT vs POST from a system administrator POV?

  • Thread starter Thread starter oslon
  • Start date Start date
Click For Summary
SUMMARY

The discussion clarifies the differences between the HTTP methods PUT and POST from a system administrator's perspective. PUT is defined as an idempotent method, meaning that repeated requests yield the same result, specifically overwriting the resource at the specified path. In contrast, POST is not idempotent and can create new resources or modify existing ones without a guaranteed outcome, allowing for greater flexibility but also potential side effects. Understanding these distinctions is crucial for effective API design and resource management.

PREREQUISITES
  • Understanding of HTTP methods, specifically PUT and POST
  • Familiarity with RESTful API principles
  • Basic knowledge of idempotency in web services
  • Awareness of resource management in server environments
NEXT STEPS
  • Research the concept of idempotency in web services and its implications
  • Learn about RESTful API design best practices
  • Explore the differences between HTTP methods in detail, including PUT, POST, GET, DELETE, and PATCH
  • Examine real-world use cases for PUT and POST in API development
USEFUL FOR

This discussion is beneficial for system administrators, web developers, and API designers who need to understand the implications of using PUT and POST in their applications for effective resource management and API functionality.

oslon
Messages
3
Reaction score
0
TL;DR
Difference between PUT vs POST from a system administrator POV?
I believe it’s important to learn concepts from a POV of X, when trying to learn something very confusing that could mean multiple meanings.

These are what I wrote in my college notes of TCP IP that I did 6 years ago.
pjTMxFbLZkOSy0G4xuXkg7hhnmpEoOBnxOoGuzBZUqeOYv6HFk.png

Much of it is confusing as both seem to be doing the same thing.
Can you tell me what’s the benefit of being idempotent? As far as I know idempotent means no matter how many times you repeat a input, you get same output.
 
Technology news on Phys.org
With PUT /path, the server accepts the data and MUST store it in /path. Making the same request again will overwrite everything in /path.

Then we can do:

GET /path to retrieve existing data;
DELETE /path to delete existing data;
PATCH /path to update only part of existing data.

I guess it makes more sense if one views these as applied to files on a server.

Initially POST was supposed to create a new set of data such as POST /customers or POST /articles for creating new customers or articles, but without identifying a URI to reach it (such as GET /article/{article-id} or GET /article?id={article-id}); it may not have one at all. You were supposed - but not obligated - to add an item to an already existing collection normally defined as /path.

With POST /path, the server accepts the data and does whatever it wants with it. This flexibility lead to use it for simulating a PUT, GET, DELETE, or PATCH with it.
 
oslon said:
TL;DR Summary: Difference between PUT vs POST from a system administrator POV?

These are what I wrote in my college notes of TCP IP that I did 6 years ago.
TCP is a lower layer of the internet protocol, the transport layer. PUT and POST are commands one layer up in the application layer, including such protocols as HTTP, HTTPS, and others.

From this page -- https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/PUT -- it says:
PUT
The HTTP PUT request method creates a new resource or replaces a representation of the target resource with the request payload.

The difference between PUT and POST is that PUT is idempotent: calling it once or several times successively has the same effect (that is no side effect), whereas successive identical POST requests may have additional effects, akin to placing an order several times.
 
  • Like
  • Haha
Likes PeterDonis and oslon
oslon said:
Can you tell me what’s the benefit of being idempotent?
Nothing bad happens if (perhaps due to a communications error) the message is processed more than once.
 
We have many threads on AI, which are mostly AI/LLM, e.g,. ChatGPT, Claude, etc. It is important to draw a distinction between AI/LLM and AI/ML/DL, where ML - Machine Learning and DL = Deep Learning. AI is a broad technology; the AI/ML/DL is being developed to handle large data sets, and even seemingly disparate datasets to rapidly evaluated the data and determine the quantitative relationships in order to understand what those relationships (about the variaboles) mean. At the Harvard &...

Similar threads

Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
1K
Replies
8
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
564
  • · Replies 17 ·
Replies
17
Views
3K
Replies
98
Views
3K
  • · Replies 3 ·
Replies
3
Views
6K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
17
Views
3K