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

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

问题描述

假设我的 Web 应用程序完全支持服务器端的 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">

除了符合 REST 标准之外,使用这两种 HTTP 方法还有什么好处吗?(假设这两种方法的替代是常用的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)

推荐答案

您的问题涉及两个密切相关但独立的标准,HTTP 和 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.

直到第 4 版的 HTML 仅定义了表单的 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天全站免登陆