??? 04/09/08 21:48 Read: times |
#153095 - GET vs POST Responding to: ???'s previous message |
Craig Steiner said:
Both GET and POST can be used for submitting or retrieving data from the server. Andy Neil said:
As I understand it, a GET Request never has a body; whereas a POST may have a body - which is why I said, "GET is for getting" At the end of the day everything is for getting stuff from the server. Even if you send a message or an image to the server, the ultimate function of the transaction is to get stuff from the server--even if you only get an acknowledgment of receipt. The only question is how much data you send to the server to provoke that response. GET and POST can be used pretty much interchangeably in most cases. Again, the exceptions are for sending rather large quantities of data where POST obviously can handle it due to the "body" submission. But you could easily send a huge amount of data (especially a large number of variables) even with GET where the only thing you get back from the server is "Yep, got it." Craig Steiner said:
POST should be used if you need to submit large amounts of data Andy Neil said:
Absolutely - that's why it has a Body! Of course. But that doesn't mean that any generalization such as "GET" is for getting and "POST" is for submitting is a valid assessment. I could agree with "POST is for submitting large quantities of data" and leave it at that. In theory you could do all transactions with the server using POST. Browsers don't do that, but they could. As could any custom client that was going to communicate with a web server. In fact it might be easier to just do everything with POST rather than writing one routine to submit GET requests and another to submit POSTs. Unless you don't need post at all in which case the process of a GET exchange is much simpler than a POST exchange. Regards, Craig Steiner |