jni*_*las 68 url uri terminology
If I have a URL like:
http://www.example.com:9090/test.html
Run Code Online (Sandbox Code Playgroud)
Then I know that www.example.com is the host name, but what do you call http://www.example.com:9090? Is there some kind of established name for that?
d4n*_*yll 68
它被称为原点.
更一般地说,这里是URL的不同部分,如下所示window.location.(所以至少根据Javascript的调用方式)
protocol://username:password@hostname:port/pathname?search#hash
-----------------------------href------------------------------
-----host----
----------- origin -------------
Run Code Online (Sandbox Code Playgroud)
protocol - URL的协议方案,包括最终的':'hostname - 域名port - 端口号pathname - /pathnamesearch - ?parametershash - #fragment_identifierusername - 在域名之前指定的用户名password - 域名前指定的密码href - 整个网址origin - protocol://hostname:porthost - hostname:port正式定义在RFC 6454第4节中.
Ric*_*uen 26
保存协议,您可以将"www.example.com"称为主机名,或者更具体地说,称为"完全限定的域名".
抛弃'9090',我个人觉得把它称为主机,因为这通常是你在HTTP请求中作为'host'标题得到的; 像'host:www.example.com:9090'.在PHP中,它将存储在$_SERVER"HTTP_HOST"或"SERVER_NAME"下的变量中.在JavaScript中,它将作为document.location.host.
一旦你投入'http://',我就不知道你能称它为什么:(
| 归档时间: |
|
| 查看次数: |
29082 次 |
| 最近记录: |