更新时间:2023-02-24 09:34:21
保留的字符
The reserved characters of an URI are mostly used as delimiters -- it doesn’t mean that they may not be used, it only means that they have a special purpose, and if you don’t need them for this purpose, you have to percent-encode them.
查询组件以第一个?
开头,以第一个#
结尾(如果有的话,否则以URI的结尾).对于查询组件本身,没有定义保留字符.
The query component starts with the first ?
and ends with the first #
(if any, otherwise with the end of the URI). For the query component itself, there are no reserved characters defined.
URI标准RFC 3986 定义查询组件可以包含这些字符:
The URI standard RFC 3986 defines that the query component can contain these characters:
a
-z
,A
-Z
0
-9
/
?
:
@
!
$
&
'
(
)
*
+
,
;
=
.
_
~
a
-z
, A
-Z
0
-9
/
?
:
@
!
$
&
'
(
)
*
+
,
;
=
-
.
_
~
它甚至明确提到:
斜杠("/")和问号(?")可能表示查询组件中的数据.
The characters slash ("/") and question mark ("?") may represent data within the query component.
示例URI的查询组件是这样的:
The query component of your example URI is this:
embedded=true&url=http://journals.plos.org/plosone/s/file?id=wjVg/PLOSOne_formatting_sample_main_body.pdf
除字母外,它还包含=
,&
,:
,/
,.
,?
,_
,所有这些在查询中都是允许的.
Apart from letters, it contains =
, &
, :
, /
, .
, ?
, _
, all of which are allowed in the query.
请注意,查询组件中的name=value
格式(由&
分隔)只是一个惯例,而不是规范中定义的内容.
Note that the name=value
format (separated by &
) in the query component is just a convention, not something defined in the specification.