What is the difference between POST and GET http method ?
Hi,
The HTTP method available are :
- POST only
- GET, POST
Why some url cannot be used with GET method ? It's just a choice ?
Cordially,
Sylvain
I don't want to bore you with lots of technical details, but to boil it down... When you see that a method requires HTTP POST, that's typically because it's performing some kind of action on the server, which likely results in a change of the server state. Generally speaking, HTTP GET requests are not supposed to change the state of the server, and are primarly for retreiving data.
Another key distinction is that with an HTTP GET request, only a URL and headers are sent to the server. With an HTTP POST request, a body is also included. Browsers impose limits on the lengths of URLs, so if you have to put all of your data in the URL, you're automatically limited in how much data you can transmit per request (and it varies by browser!). This makes HTTP POST ideal for transmitting data to the server, such as in the case of posting a new message or uploading an image.
I hope this helps!