如何在url中使用符号(@)?

时间:2018-02-27 11:25:31

标签: url browser uri

例如,我遇到此网址类型:http://username:token@example.com/protected/files

我在网上搜索了这个,但我找不到我的预期。

2 个答案:

答案 0 :(得分:1)

维基百科很好地解释了the syntax of a URI

scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]

答案 1 :(得分:0)

您的username:token@example.com/protected/files可能与URL相似,但如果不是,则因为它不包含访问数据的协议。这是一个uri。

浏览器(我想你指的是网络浏览器)可以使用URL,它是包含协议的URI的子类型。请注意Web浏览器不能使用所有现有协议,只能使用其中一些协议(http,https,ftp,file ...)username不是协议。