Escaping ampersand in URL

前端 未结 8 1390
余生分开走
余生分开走 2020-11-22 03:25

I am trying to send a GET message that contains strings with ampersands and can\'t figure how to escape the ampersand in the URL.

Example:

http://www         


        
8条回答
  •  离开以前
    2020-11-22 03:31

    You can use the % character to 'escape' characters that aren't allowed in URLs. See [RFC 1738].

    A table of ASCII values on http://www.asciitable.com/.

    You can see & is 26 in hexadecimal - so you need M%26M.

提交回复
热议问题