From what I can gather, there are three categories:
GET
and use POST
POST
and use GET
Am I correct in assuming those three cases? If so, what are some examples from each case?
Both GET and POST method is used to transfer data from client to server in HTTP protocol but Main difference between POST and GET method is that GET carries request parameter appended in URL string while POST carries request parameter in message body which makes it more secure way of transferring data from client to ...
What difference does it make if you use POST versus GET requests in your applications? Here's just what you need to know. At a high level, when interacting with a Web server POST requests place user parameters in the body of the HTTP request. On the other hand, GET requests place such parameters in the URL.
GET has a limitation on the length of the values, generally 255 characters whereas POST has no limitation on the length of the values since they are submitted via the body of HTTP. GET method supports only string data types while POST method supports different data types, such as string, numeric, binary, etc.
Use POST
for destructive actions such as creation (I'm aware of the irony), editing, and deletion, because you can't hit a POST
action in the address bar of your browser. Use GET
when it's safe to allow a person to call an action. So a URL like:
http://myblog.org/admin/posts/delete/357
Should bring you to a confirmation page, rather than simply deleting the item. It's far easier to avoid accidents this way.
POST
is also more secure than GET
, because you aren't sticking information into a URL. And so using GET
as the method
for an HTML form that collects a password or other sensitive information is not the best idea.
One final note: POST
can transmit a larger amount of information than GET
. 'POST' has no size restrictions for transmitted data, whilst 'GET' is limited to 2048 characters.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With