What characters can one use in a URL?

前端 未结 4 580
故里飘歌
故里飘歌 2021-01-04 05:07

I have an application that takes all the parameters in the url like this: /category/subcategory/sub-subcategory. I want to be able to give out extra parameters

4条回答
  •  情歌与酒
    2021-01-04 05:19

    The most recent URI spec is RFC 3986; see the ABNF for details on what characters are allowed in which parts for the URI.

    The format for an absolute path part is:

      path-absolute = "/" [ segment-nz *( "/" segment ) ]
      segment       = *pchar
      segment-nz    = 1*pchar
      pchar         = unreserved / pct-encoded / sub-delims / ":" / "@"
      pct-encoded   = "%" HEXDIG HEXDIG
      unreserved    = ALPHA / DIGIT / "-" / "." / "_" / "~"
      sub-delims    = "!" / "$" / "&" / "'" / "(" / ")"
                          / "*" / "+" / "," / ";" / "="
    

提交回复
热议问题