スペース文字の URL が %20 にエンコードされるのはなぜですか? スペースが予約文字と見なされる理由がわかりません。
1378 次
3 に答える
2
RFC 3986 セクション 2.3を参照してください。
2.3. Unreserved Characters
Characters that are allowed in a URI but do not have a reserved
purpose are called unreserved. These include uppercase and lowercase
letters, decimal digits, hyphen, period, underscore, and tilde.
unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~"
于 2013-06-17T12:55:42.173 に答える
2
HTTP リクエストのRequest-Lineは次のように定義されているためです。
Method (Space) Request-URI (Space) HTTP-Version CRLF
仕様に厳密に準拠する単純な HTTP サーバーは、次のようなことを行います。
splitInput = requestLine.Split(' ')
method = splitInput[0]
requestUri = splitInput[1]
httpVersion = splitInput[2]
URLにスペースを許可すると、それが壊れます。
于 2013-06-17T13:10:09.773 に答える