Skip to content Skip to sidebar Skip to footer

Get And Post Method In Html

what is the meaning of these three statements: If get method is used and if the page is refreshed it would not prompt before the request is submitted again. If the response of the

Solution 1:

It would help to have the context where you found those guidelines, but:

If someone reloads a page which resulted from a POST operation, they'll usually get a confirmation dialog like "Do you want to resend the submitted data?", which is a useful warning for operations which have side-effects, such as creating records in a database. You don't want people to blindly create multiple copies of the same order, for instance.

If someone reloads a page which resulted from a GET operation, it will be refreshed without any further confirmation, on the assumption that there will be no potentially undesirable side-effects on the server.

There are also other considerations. You can create a direct link to a GET request, but not a POST, and POST data won't be stored in the browser history (though may be stored in other things like plugins or form-fillers).


Solution 2:

These statements appear to be giving guidance on when to use get vs post. The basic idea is that get is for read-only operations, and post is for update operations.


Solution 3:

GET is supposed to be idempotent - i.e. no matter how many times you repeat the operation, the result will be the same. The GET operation by itself does not cause a change in the service / data. e.g. load a thread on stack overflow. Doing get multiple times has no affect on the backend service.

POST on the other hand may cause a change in the backend data/service. e.g. post a new message to stack overflow. Doing the same post multiple times will cause the message to be posted multiple times.


Solution 4:

It says that if there is select operation of a database then perform GET operation as it will not change any data or modify in a database but if you use Deletion or Insertion this may change with GET which is not good as if Web Crawler also do some changes which is not good for any website.


Post a Comment for "Get And Post Method In Html"