Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML form action method="POST" or method="post"? [duplicate]

Tags:

Is there any difference in using non-capticalized "post" or capitalized "POST" in <form> action method? I just want to strictly follow W3C HTML specification.

This is no difference when running in modern browsers, though.

like image 354
Raptor Avatar asked Mar 30 '11 03:03

Raptor


People also ask

What is form action method post?

The method attribute specifies how to send form-data (the form-data is sent to the page specified in the action attribute). 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.

What is POST method in HTML form?

POST: In the post method, after the submission of the form, the form values will not be visible in the address bar of the new browser tab as it was visible in the GET method. It appends form data inside the body of the HTTP request. It has no size limitation. This method does not support bookmark the result.

How does HTML form action work?

The HTML form action attribute states the URL that will process the contents of a form. You should make sure the web resource to which the action attribute points accepts whatever method you have specified in your “method” attribute. The action attribute appears between our opening <form> tag.

Can a form have two actions in HTML?

Let's learn the steps of performing multiple actions with multiple buttons in a single HTML form: Create a form with method 'post' and set the value of the action attribute to a default URL where you want to send the form data. Create the input fields inside the as per your concern. Create a button with type submit.


2 Answers

From the w3c docs for forms:

Possible (case-insensitive) values are "get" (the default) and "post".

like image 178
zxt Avatar answered Sep 19 '22 16:09

zxt


No difference! I always use lower case.

like image 33
Andrew Jackman Avatar answered Sep 18 '22 16:09

Andrew Jackman