Rohit Pareek
Rohit Pareek

Reputation: 1563

Form Submission method in html?

I know that there are two methods of submitting a form: 'GET' and 'POST'. We can also use request method for accessing the content of the submitted.
I want to know whether there is any other method of submitting the form. As far as my knowledge there are only two methods. But some one asked me this question in a interview that there are 5 method of submitting the form.
If any one has any idea about this please tell me.

Upvotes: 1

Views: 2063

Answers (2)

Nivas
Nivas

Reputation: 18334

The question was probably about HTTP request methods. There 9 request methods:

HTTP defines nine methods (sometimes referred to as "verbs") indicating the desired action to be performed on the identified resource. What this resource represents, whether pre-existing data or data that is generated dynamically, depends on the implementation of the server. Often, the resource corresponds to a file or the output of an executable residing on the server.

HEAD: Asks for the response identical to the one that would correspond to a GET request, but without the response body. This is useful for retrieving meta-information written in response headers, without having to transport the entire content.

GET: Requests a representation of the specified resource. Requests using GET (and a few other HTTP methods) "SHOULD NOT have the significance of taking an action other than retrieval". The W3C has published guidance principles on this distinction, saying, "Web application design should be informed by the above principles, but also by the relevant limitations." See safe methods below.

POST: Submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.

PUT: Uploads a representation of the specified resource.

DELETE: Deletes the specified resource.

TRACE: Echoes back the received request, so that a client can see what (if any) changes or additions have been made by intermediate servers.

OPTIONS: Returns the HTTP methods that the server supports for specified URL. This can be used to check the functionality of a web server by requesting '*' instead of a specific resource.

CONNECT: Converts the request connection to a transparent TCP/IP tunnel, usually to facilitate SSL-encrypted communication (HTTPS) through an unencrypted HTTP proxy.

PATCH: Is used to apply partial modifications to a resource.

HTTP servers are required to implement at least the GET and HEAD methods

Upvotes: 2

ShaneC
ShaneC

Reputation: 2406

The HTML form element's method only accepts two parameters, GET and POST. Evidenced by this entry on the W3 Standards site:

  method      (GET|POST)     GET       -- HTTP method used to submit the form--

They may have been asking you about ways to submit the data. In which case there are many more, like AJAX, Flash, P2P types, etc.

However if they specifically said FORM, as in the HTML FORM element -- then no. POST and GET.

Addendum: Here is a StackOverflow question asked on a similar topic. In that the answerer highlights other methods which can be submitted via AJAX. Again, though, note that these are down through AJAX and not strictly through the FORM element.

Upvotes: 2

Related Questions