【问题标题】:What's the name of the part of the URL before the query string?查询字符串之前的 URL 部分的名称是什么?
【发布时间】:2011-08-26 17:21:46
【问题描述】:

获取以下网址:http://3.chart.apis.google.com/chart?cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100

可以分解如下:

  • 协议:http
  • 主机名:3.chart.apis.google.com
  • 路径:chart
  • 查询:cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100

我在寻找协议的名称、主机名和路径?即查询字符串之前的所有内容。

【问题讨论】:

    标签: http url naming-conventions


    【解决方案1】:

    URI as specified by RFC 3986而言,URIhttp://3.chart.apis.google.com/chart?cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100由以下组件组成:

    • httpscheme
    • //3.chart.apis.google.com/chart – 分层部分
    • cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100 - query

    【讨论】:

      【解决方案2】:

      对于 URL 的那些部分(或 URI,如果您愿意)没有规范名称,但不包括查询字符串。该字符串的全部内容是一个 URL,其中包括:

      方案/协议
      域名
      端口(如果未指定,则假定为协议的默认值)
      路径
      查询字符串

      见:http://en.wikipedia.org/wiki/Uniform_Resource_Locator

      【讨论】:

      • 没有规范名称,现在我知道了。干杯
      猜你喜欢
      • 1970-01-01
      • 2012-11-02
      • 2013-11-19
      • 1970-01-01
      • 2020-11-25
      • 2016-03-09
      • 1970-01-01
      • 1970-01-01
      • 2018-05-28
      相关资源
      最近更新 更多