html - 默认表单 HTTP 方法是什么?

标签 html forms

提交 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 --
  >

好读

Methods GET and POST in HTML forms - what's the difference?

关于html - 默认表单 HTTP 方法是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2314401/

相关文章:

HTML 文件上传操作 - 这是否会被黑客攻击而导致垃圾邮件无休止的文件上传

javascript - 如何将值从一个 Javascript 文件传输到另一个 JS 文件,而不需要服务器交互或 cookie?

html - 显示 :none when rotating smartphone

html - 根据 div 居中图标并在 div 之间放置空间

javascript - 如何阻止表单自动提交? (Django/jQuery)

jQuery 提交表单无需重新加载页面

forms - 在 MS Access 中使用封闭表单的公共(public)方法

javascript document.createElement 或 HTML 标签

html - 填充链接周围出现的边距

javascript - 如何在 JavaScript 中通过键为变量赋值