简体   繁体   English

是否可以使用HTTP PUT提交表单数据?

[英]Is it possible to use an HTTP PUT to submit form data?

Simple question: everyone knows you can POST data in a HTML form to the server, and the browser will handle serializing the data in the form. 简单问题:每个人都知道您可以将HTML表单中的数据发布到服务器,浏览器将处理表单中数据的序列化。

However, is it possible to do this using a PUT verb instead? 但是,是否可以使用PUT动词来做到这一点? Either through Javascript or some other means. 通过Javascript或其他方式。

No. Section 9.6 on RFC 2616 states that the URI is of the resource to be put, and the web server must not use it towards any other resource. RFC 2616上的第9.6节规定URI是要放置的资源,并且Web服务器不得将其用于任何其他资源。 So, while technically you may be able to construct a server process/script that would, you should not depend on any server allowing that. 因此,虽然从技术上讲,您可能能够构建一个服务器进程/脚本,但您不应该依赖任何允许这样做的服务器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM