如何在 url 中使用符号 (@)?
How can I use at symbol (@) in url?
例如我遇到这个 url 类型:http://username:token@example.com/protected/files
.
我在网上搜索了这个,但没有找到我想要的。
维基百科解释得很好the syntax of a URI:
scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
您的 username:token@example.com/protected/files
可能看起来像 URL,但实际上并非如此,因为它不包含访问数据的协议。这是一个uri。
浏览器(我想您指的是 Web 浏览器)可以使用 URL,它是包含协议的 URI 的子类型。请注意,网络浏览器并不适用于所有现有协议,仅适用于其中一些协议(http、https、ftp、文件...)username
不是协议。
例如我遇到这个 url 类型:http://username:token@example.com/protected/files
.
我在网上搜索了这个,但没有找到我想要的。
维基百科解释得很好the syntax of a URI:
scheme:[//[user[:password]@]host[:port]][/path][?query][#fragment]
您的 username:token@example.com/protected/files
可能看起来像 URL,但实际上并非如此,因为它不包含访问数据的协议。这是一个uri。
浏览器(我想您指的是 Web 浏览器)可以使用 URL,它是包含协议的 URI 的子类型。请注意,网络浏览器并不适用于所有现有协议,仅适用于其中一些协议(http、https、ftp、文件...)username
不是协议。