POST与发布,GET与获取 [英] POST vs post, GET vs get

查看:191
本文介绍了POST与发布,GET与获取的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

 < form method =POST /> 

vs。

 < form method =post/> 

为什么要使用其中一个?

解决方案

W3C向属性名称和值倾向于小写一段时间。



例如 xhtml 1.0 standard

lockquote


4.11。具有预定义值集的属性

HTML 4和XHTML都有一些
属性,它们具有预定义的值和
有限的值集输入元素的类型
属性)。在
SGML和XML中,这些被称为
枚举属性。在HTML 4中,
对这些值的解释是
不区分大小写,所以TEXT
的值相当于文本值。
在XML下,这些
值的解释区分大小写,而在XHTML
1中,所有这些值均以
小写字母定义。




I realize that both will work, but is one more correct than the other?

<form method="POST" />

vs.

<form method="post" />

Why use one or the other?

解决方案

W3C has tended towards lowercase for attribute names and values for a while.

For example section 4.11 of the xhtml 1.0 standard in 2002:

4.11. Attributes with pre-defined value sets

HTML 4 and XHTML both have some attributes that have pre-defined and limited sets of values (e.g. the type attribute of the input element). In SGML and XML, these are called enumerated attributes. Under HTML 4, the interpretation of these values was case-insensitive, so a value of TEXT was equivalent to a value of text. Under XML, the interpretation of these values is case-sensitive, and in XHTML 1 all of these values are defined in lower-case.

这篇关于POST与发布,GET与获取的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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