默认的表单 HTTP 方法是什么? [英] What is the default form HTTP method?

查看:37
本文介绍了默认的表单 HTTP 方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当没有指定方法提交 HTML 表单时,默认使用的 HTTP 方法是什么?获取还是发布?

When an HTML form is submitted without specifying a method, what is the default HTTP method used? GET or POST?

这种行为是否在 HTML 标准之间发生过变化?

Has this behaviour ever changed between HTML standards?

如果可能,请引用 W3C 标准文档.

Please cite a W3C standard document if possible.

推荐答案

这是 GET.

看看 W3C 取代了建议 17.3 FORM 元素.

摘录:

<!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 表单中的 GET 和 POST 方法 - 有什么区别?

这篇关于默认的表单 HTTP 方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆