As we know, the form data in html can be submitted through GET method or POST method.
But in Http RFC, it is said that
In particular, the convention has been established that the GET and HEAD methods SHOULD NOT have the significance of taking an action other than retrieval.
Then why can we submit form data to the server through GET method? Should GET method just be used to retrieval?
The form-data can be sent as URL variables (with method="get" ) or as HTTP post transaction (with method="post" ). Notes on GET: Appends form-data into the URL in name/value pairs. The length of a URL is limited (about 3000 characters)
The GET method is the method used by the browser to ask the server to send back a given resource: "Hey server, I want to get this resource." In this case, the browser sends an empty body. Because the body is empty, if a form is sent using this method the data sent to the server is appended to the URL.
The HTML <form> method Attribute is used to specify the HTTP method used to send data while submitting the form. There are two kinds of HTTP methods, which are GET and POST. The method attribute can be used with the <form> element.
The Correct Answer is " Request.
You seem to be operating under the misconception that a form can't be used for information retrieval.
There are forms where the information entered by the user is used to decide what information to retrieve. The information isn't stored anywhere (at least not in a fashion that is significant, e.g. it might be logged).
An example of a form of this nature is the big one on the homepage of any search engine (like Google or Duckduckgo).
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