html - application/x-www-form-urlencoded 是 html 表单的默认值吗?

标签 html forms enctype

我发现 HTML 表单只支持两种 enctype 类型。它们是 application/x-www-form-urlencodedmultipart/form-data。我知道我在需要上传文件时使用 multipart/form-data。什么时候使用 application/x-www-form-urlencoded?它是默认形式 enctype 吗?

最佳答案

是的,是的。这是来自 W3 HTML forms specification 的引用:

The default value for this attribute is "application/x-www-form-urlencoded". The value "multipart/form-data" should be used in combination with the INPUT element, type="file".

网络浏览器将关注 URL encoding自动。

关于html - application/x-www-form-urlencoded 是 html 表单的默认值吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2436716/

相关文章:

forms - 如何检测 Form Resize END,可能是通过使用 TApplicationEvents 组件?

html - 发送带有特殊字符的 html 电子邮件时使用 htmlentities 是否更好?

forms - JQuery 移动选择选项文本太长

html - CSS:选择器属性继承

python - 如何根据 Flask 中的单选按钮值重定向?

php - 将焦点设置到输入框

forms - 添加一个值到登录表单 joomla 2.5

html - <选择多个> 和 enctype ="multipart/form-data"

html - CSS 指的是每个奇怪的嵌套子项?