我们可以使用 &在网址? [英] Can we use & in url?
本文介绍了我们可以使用 &在网址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们可以使用&"吗?在网址中?还是应该使用和"?
Can we use "&" in a url ? or should "and" be used?
推荐答案
是的,您可以像这样在 URL 路径中使用它:
Yes, you can use it plain in your URL path like this:
http://example.com/Alice&Bob
仅当您想在查询中使用它时,您才需要使用 %26
对其进行编码:
Only if you want to use it in the query you need to encode it with %26
:
http://example.com/?arg=Alice%26Bob
否则,当解释为 application/x-www-form-urlencoded.
Otherwise it would be interpreted as argument separator when interpreted as application/x-www-form-urlencoded.
有关详细信息,请参阅 RFC 3986.
See RFC 3986 for more details.
这篇关于我们可以使用 &在网址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文