Are slashes allowed in URL fragment or query?

后端 未结 3 872
忘了有多久
忘了有多久 2021-01-06 13:58

My understanding of the general form of a URL is that it looks as follows:

://?#
         


        
3条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-06 14:23

    Fragment can contain any character at all.

    Query can contain any character except for #, as it is treated as marker (but you can use URL-encoding to still have it there)

    So, in general, there are no any reserved characters as long as there is no ambiguity.

    See RFC 3987 for the most up-to-date info. Your "general form" is not exactly right

提交回复
热议问题