提交 HTML 表单时未指定方法时,默认使用的 HTTP 方法是什么?获取还是发布?
这种行为在 HTML 标准之间是否发生过变化?
如果可能,请引用 W3C 标准文档。
最佳答案
它是 GET。
看看W3C Superceded Recommendation 17.3 The FORM element .
摘录:
<!ATTLIST FORM
%attrs; -- %coreattrs, %i18n, %events --
action %URI; #REQUIRED -- server-side form handler --
method (GET|POST) GET -- HTTP method used to submit the form--
enctype %ContentType; "application/x-www-form-urlencoded"
accept %ContentTypes; #IMPLIED -- list of MIME types for file upload --
name CDATA #IMPLIED -- name of form for scripting --
onsubmit %Script; #IMPLIED -- the form was submitted --
onreset %Script; #IMPLIED -- the form was reset --
accept-charset %Charsets; #IMPLIED -- list of supported charsets --
>
好读
关于html - 默认表单 HTTP 方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2314401/