HTML表单PUT方法 [英] HTML form PUT method
问题描述
因为服务器端只接受PUT方法,所以我在HTML表单中使用了 method ='PUT'
。但浏览器并没有像预期的那样使用方法PUT,它是 GET
。当我设置 method ='POST'
时,它是 POST
。
我不知道为什么 method ='PUT'
不起作用。浏览器只支持 POST
和 GET
,如果您需要 PUT
,您必须通过post / get发送表单,然后执行正确的<
$ b
EDIT 虽然XMLHttpRequest的大部分实现都支持 PUT
code> PUT 和 DELETE
。
Because the server side only accepts PUT method, I used method='PUT'
in the HTML form. But the browser didn't use method PUT as expected, it's GET
. When I set method='POST'
it's POST
.
I don't know why method='PUT'
doesn't work. I have tested on Chrome and Firefox.
Browsers only support POST
and GET
, if you need PUT
, you have to send the form via post/get and then do the proper PUT
request on server-side.
EDIT although, most implementations of XMLHttpRequest support PUT
and DELETE
.
这篇关于HTML表单PUT方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!