URL的一部分:主机,端口,路径

pet*_*ski 17 web-services host path

这是URL:

https://landfill.bugzilla.org/bugzilla-tip/
Run Code Online (Sandbox Code Playgroud)

在我的代码中我有这个:

Server server = new Server(host, port, path);
Run Code Online (Sandbox Code Playgroud)

从URL,什么是主机,什么是端口和什么是路径?该方法的输入值是多少?

use*_*142 21

主持人:landfill.bugzilla.org

端口:443(默认)

路径:bugzilla-tip

http://tools.ietf.org/html/rfc1738


Kar*_*son 13

不幸的是,这个问题中的其他答案可能会有些误导。在此特定示例中引用landfill.bugzilla.orgashost是正确的,但如果端口不是443那么它将是不正确的。

https://默认情况下使用 port 443,所以你可以在 中省略它URL,否则它看起来像这样https://landfill.bugzilla.org:443/bugzilla-tip

  • 协议https://
  • 主机名landfill.bugzilla.org
  • 端口:443
  • 主持人landfill.bugzilla.org:443
  • 路径bugzilla-tip

host而且hostname不一样!当使用协议上的默认端口时,它只是“相同”!

更多信息:https : //tools.ietf.org/html/rfc1738


Chu*_*k R 12

  • 主办: landfill.bugzilla.org
  • 端口:443(HTTPS)
  • 路径: /bugzilla-tip

有关详细信息,请阅读此内容