What does dollar sign $ do in url?

前端 未结 2 1012
难免孤独
难免孤独 2021-02-01 03:56

I have been reading that $ ! ; . , are \'reserved\' chars in url. But I can not find what are they reserved for.

/ path delimiter  
: port
? query         


        
2条回答
  •  春和景丽
    2021-02-01 04:15

    Your question is a bit broad, but the RFC 2396 should contain all your answers.

    Many URI include components consisting of or delimited by, certain special characters. These characters are called "reserved", since their usage within the URI component is limited to their reserved purpose. If the data for a URI component would conflict with the reserved purpose, then the conflicting data must be escaped before forming the URI.

     reserved    = ";" | "/" | "?" | ":" | "@" | "&" | "=" | "+" |
                    "$" | ","
    

    The "reserved" syntax class above refers to those characters that are allowed within a URI, but which may not be allowed within a particular component of the generic URI syntax; they are used as delimiters of the components described in Section 3.

    Characters in the "reserved" set are not reserved in all contexts. The set of characters actually reserved within any given URI component is defined by that component. In general, a character is reserved if the semantics of the URI changes if the character is replaced with its escaped US-ASCII encoding.

提交回复
热议问题