This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 23116 - Form method attribute only accepts 'get' and 'post'
Summary: Form method attribute only accepts 'get' and 'post'
Status: CLOSED WONTFIX
Alias: None
Product: HTML WG
Classification: Unclassified
Component: HTML5 spec (show other bugs)
Version: unspecified
Hardware: All All
: P3 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: HTML WG Bugzilla archive list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-08-31 14:06 UTC by Moo
Modified: 2013-09-03 17:25 UTC (History)
6 users (show)

See Also:


Attachments

Description Moo 2013-08-31 14:06:43 UTC
As per chapter 4.10.19.5 Form submission

The 'method' attribute of the 'form' element only accepst the values 'get' and 'post'.

It does not support other valid and standard HTTP request methods such as PUT and DELETE which are useful when building RESTful web applications and services.
Comment 1 Dio Synodinos 2013-09-02 11:38:10 UTC
These seem to have been dropped in 2010 [1] because of lack of use cases [2]. Do you have any use cases to suggest?

[1] http://www.w3.org/TR/2010/WD-html5-diff-20101019/#changes-2010-06-24
[2] http://lists.w3.org/Archives/Public/public-html/2010Sep/0209.html
Comment 2 Moo 2013-09-02 12:56:03 UTC
== Use case for DELETE ==
A page has a list of favorites/bookmarks.
Next to each bookmark is a 'input' element of type 'submit'.

When submitted, it submit a DELETE /Bookmark/123 request.

The server removes the bookmark for that user from the database, and returns a page stating "Bookmark removed".

<form action="/Bookmark/123" method="delete">
  <input type="submit" value="Delete" />
</form>


== Use case for PUT ==
User clicks on "Edit profile".
User changes text, and presses the submit button.
Server updates the user's profile with the new data and returns a confirmation.

<form action="/Profile/" method="put">
  <textarea name="profile" cols="80" rows="10"></textarea>
  <input type="submit" value="Update profile" />
</form>
Comment 3 Dio Synodinos 2013-09-02 15:29:25 UTC
Isn't this covered by XHR Level 2 which all browsers support?

(In reply to comment #2)
> == Use case for DELETE ==
> A page has a list of favorites/bookmarks.
> Next to each bookmark is a 'input' element of type 'submit'.
> 
> When submitted, it submit a DELETE /Bookmark/123 request.
> 
> The server removes the bookmark for that user from the database, and returns
> a page stating "Bookmark removed".
> 
> <form action="/Bookmark/123" method="delete">
>   <input type="submit" value="Delete" />
> </form>
> 
> 
> == Use case for PUT ==
> User clicks on "Edit profile".
> User changes text, and presses the submit button.
> Server updates the user's profile with the new data and returns a
> confirmation.
> 
> <form action="/Profile/" method="put">
>   <textarea name="profile" cols="80" rows="10"></textarea>
>   <input type="submit" value="Update profile" />
> </form>
Comment 4 Moo 2013-09-02 17:36:09 UTC
(In reply to comment #3)
> Isn't this covered by XHR Level 2 which all browsers support?

Oh, yes it is, according to ยง 4.7.1
http://www.w3.org/TR/XMLHttpRequest2/#the-open-method

It supports CONNECT, DELETE, GET, HEAD, OPTIONS, POST, PUT, TRACE, and TRACK.

I didn't think of this. Then it is possible to use XHR so it is less needed for forms. Although, it might be useful for forms too if the above use cases are rational and sane (they might not be?).
Comment 5 Robin Berjon 2013-09-03 11:18:18 UTC
(In reply to comment #4)
> I didn't think of this. Then it is possible to use XHR so it is less needed
> for forms. Although, it might be useful for forms too if the above use cases
> are rational and sane (they might not be?).

EDITOR'S RESPONSE: This is an Editor's Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Rejected
Change Description: none
Rationale: It could indeed be interesting in theory, but in practice and as indicated in the message quoted in #1 it would require figuring out the interaction model and how to set some headers along the way. Without those, the addition isn't very useful. In fact, even with those the chances are pretty big that the default interaction won't be what developers want, and people will have to resort to XHR anyway. XHR works well for this, so the need is met.
Comment 6 Cameron Jones 2013-09-03 11:44:53 UTC
There is an active change proposal for additional form methods, registered under issue 195 - see here for details:

http://www.w3.org/html/wg/tracker/issues/195


For a completed extension specificaion see:

http://cameronjones.github.io/form-http-extensions/index.html


Please send feedback and/or comments to public-html or public-html-comments.