HTML 表单的默认编码类型是什么?

eck*_*kes 4 html forms enctype

假设我有一个包含一些输入的表单:

<form action="demo_post_enctype.asp" method="post" >
  First name: <input type="text" name="fname"><br>
  Last name: <input type="text" name="lname"><br>
  <input type="submit" value="Submit">
</form>
Run Code Online (Sandbox Code Playgroud)

如果我提交此表单:浏览器使用哪种编码类型?

是否有明确定义的默认类型?
还是每个浏览器都选择自己的 enctype(当然是在三个允许的类型中)?

Que*_*tin 7

这些属性的无效值默认是application/x-www-form-urlencoded状态。enctype 属性的缺失值默认值也是application/x-www-form-urlencodedstate。(formenctype 属性没有缺失值默认值。)

HTML 5

此属性指定用于向服务器提交表单的内容类型(当 method 的值为“post”时)。此属性的默认值为“ application/x-www-form-urlencoded”。值“ multipart/form-data”应与 INPUT 元素 type="file" 结合使用。

HTML 4

这决定了用于对表单内容进行编码的机制。它默认为application/x-www-form-urlencoded.

HTML 3.2