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

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

问题描述

我意识到两者都可以,但是一个比另一个更正确吗?

对比

为什么要使用其中一个?

解决方案

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

例如,2002 年 xhtml 1.0 标准的第 4.11 节:

<块引用><块引用>

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.

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

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