What is the difference between GET vs POST vs PUT? Mainly POST vs PUT?

  • Context: Comp Sci 
  • Thread starter Thread starter shivajikobardan
  • Start date Start date
  • Tags Tags
    Difference
Click For Summary

Discussion Overview

The discussion revolves around the differences between the HTTP methods GET, POST, and PUT, with a primary focus on distinguishing POST from PUT. Participants explore the definitions, functionalities, and practical applications of these methods within the context of the HTTP protocol.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • One participant expresses confusion regarding the differences between PUT and POST, noting that both seem to serve similar purposes in submitting data to a server.
  • Another participant provides a comparison of attributes for POST and PUT, highlighting aspects such as idempotency, safety, and whether they are allowed in HTML forms.
  • It is mentioned that PUT is idempotent, meaning repeated requests yield the same result, while POST is not idempotent.
  • Concerns are raised about the lack of clear definitions and practical examples available online, leading to frustration in understanding the concepts.
  • Some participants suggest using tools like Wireshark or Fiddler to observe the differences in request verbs and responses from the server.
  • Multiple participants refer to external resources, including developer documentation and Wikipedia, for further clarification on the topic.

Areas of Agreement / Disagreement

Participants do not reach a consensus on the differences between POST and PUT, with ongoing confusion and varying interpretations of their functionalities and definitions.

Contextual Notes

Participants express uncertainty about the practical implications of using PUT versus POST, particularly in terms of how data is sent and retrieved. There are references to idempotency and safety, but these concepts remain inadequately defined for some participants.

shivajikobardan
Messages
637
Reaction score
54
Homework Statement
HJTTP request message format
Relevant Equations
none
First of all I am not learning this currently from web development Point of view. So I think I don’t need the extreme level of understanding. I am studying this in a topic called “HTTP protocol”. And in my opinion, I need to learn enough to write what it does in exam paper.

It is so confusing in internet. I can’t explain enough. Firstly I was just confused between PUT and POST. But later someone started to tell me that you could use GET instead of these two in submitting form. That got me confused to next level.

What I have already understood(be it wrong or right I am not sure).

GET-: It helps to retrieve the file indicated by URL in request line from server.

PUT and POST seems same thing to me.

PUT places data in body to the URL in request line.
POST has no such definitions anywhere in books or internet. And it is generalized as “POST is used to submit form data”.
But the gist of these two seems similar ie post data to server. What’s the difference?

And there are like 6,670,000,000 results in google.
But I don’t know how stupid I am to not get this.Most articles in internet are copied from each other and written pretty unprofessionally. I am not very smart. I mean smart in the sense that one who can understand anything taught by anyone and doesn’t need that clarity. I need something very simplified to understand and I don’t find it at least till now.

https://stackoverflow.com/questions/630453/what-is-the-difference-between-post-and-put-in-http
https://stackoverflow.com/questions...ference-between-a-post-and-a-put-http-request

These are perhaps the only reputable answers about this but I find them very confusing.

They say idemptotencyy is there in some and not in other. But I want their basic difference in working.(PUT is idempotent).
Idempotent means you can keep repeating the same thing again and again but the final result will be the same as the initial result that happened when you did that thing for the first time.

Is this the only difference between POST and PUT working and is their definition same?
Another thing that I am seeing is PUT keeps data to be sent in URL whereas POST doesn’t do it. How do we know about it? I can’t see any information that shows this thing practically. (They say while googling you use PUT so that you can visit that page again as well.) But IDK how to explain, I don’t know how.
Just tell me the difference between PUT and POST in terms of real working difference, Like how they work. Thanks for the information.
 
Physics news on Phys.org
Here are some differences I found at this site: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods. You can drill down on this page to find descriptions of put and post. Each page includes a table of attributes of the HTTP verb (action) being described.

Both - the request has a body.
Success response in body? post - yes, put - no
Safe? post - no, put - yes
Idempotent? post - no, put - yes
Cacheable? post - only if freshness info is included, put - no
Allowed in HTML forms? post - yes, put - no

As far as seeing the information, are you using any "sniffer" tools such as Wireshark or Fiddler? These tools show the request verbs (such as GET, POST, PUT, PATCH, and others) as well as the responses sent back from the server.
 
  • Like
Likes   Reactions: shivajikobardan
Mark44 said:
Here are some differences I found at this site: https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods. You can drill down on this page to find descriptions of put and post. Each page includes a table of attributes of the HTTP verb (action) being described.

Both - the request has a body.
Success response in body? post - yes, put - no
Safe? post - no, put - yes
Idempotent? post - no, put - yes
Cacheable? post - only if freshness info is included, put - no
Allowed in HTML forms? post - yes, put - no

As far as seeing the information, are you using any "sniffer" tools such as Wireshark or Fiddler? These tools show the request verbs (such as GET, POST, PUT, PATCH, and others) as well as the responses sent back from the server.
nice thanks.
 

Similar threads

Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 22 ·
Replies
22
Views
2K
  • · Replies 3 ·
Replies
3
Views
1K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 10 ·
Replies
10
Views
4K
  • · Replies 1 ·
Replies
1
Views
1K