应该在表单中使用PUT和DELETE吗? [英] Should PUT and DELETE be used in forms?

查看:665
本文介绍了应该在表单中使用PUT和DELETE吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

假设我的网络应用程序在服务器端完全支持PUT和DELETE,我应该使用它们吗?

Assuming my web application has full support of PUT and DELETE on the server side, should I make use of them?

基本上我的问题是有多少浏览器支持这个:

Basically my question is how many browsers support this:

<form method="PUT">

<form method="DELETE">

使用这两种HTTP方法是否有什么好处,而不是符合REST? (假设这两个方法的替换是通常使用的POST)

Is there any benefits to using these two HTTP Methods other than being REST-compliant? (assuming the replacement for these two methods is the commonly used POST)

推荐答案

您的问题涉及两个密切相关,和HTML。 PUT和DELETE方法是HTTP的一部分。在HTTP中,它们在RESTful接口和其他基于HTTP的服务(如Webdav)上有明显的用途。

Your question involves two closely related but separate standards, HTTP and HTML. The PUT and DELETE methods are part of HTTP. In HTTP they have obvious use in RESTful interfaces, and other services which build on HTTP such as Webdav.

HTML到版本4只定义了使用POST和GET形式。 HTML5在这个时候似乎似乎可能支持进一步的方法。 [注意,支持不包括在当前的w3草案]

HTML up to version 4 only defines the use of POST and GET for forms. HTML5 at this time appears as though it may support the further methods. [note, support is not included in the current w3 draft]

任何当前的浏览器支持(我不知道任何)将非常有限,只有真正有用作为出血边缘的实验。

Any current browser support (I'm not directly aware of any) will be very limited and only really useful as an experiment at the bleeding edge.

这篇关于应该在表单中使用PUT和DELETE吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆