开发者

What's the name of the part of the URL before the query string?

Take the following URL: http://3.chart.apis.google.com/chart?cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100

It can be broken开发者_开发技巧 down as follows:

  • Protocol: http
  • Hostname: 3.chart.apis.google.com
  • Path: chart
  • Query: cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100

I'm looking for the name of the protocol, hostname and path? i.e. everything up to the query string.


In terms of URI as specified by RFC 3986, the URI http://3.chart.apis.google.com/chart?cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100 consists of the following components:

  • http – scheme
  • //3.chart.apis.google.com/chart – hierarchical part
    • 3.chart.apis.google.com – authority
      • 3.chart.apis.google.com – host
    • /chart – path
  • cht=p&chd=t:1,2,3&chl=a|b|c&chs=300x100 – query


there is no canonical name for those parts of the URL (or URI if you like) up to but not including the querystring. the entirety of that string is a URL which consists of:

Scheme/Protocol
Domain
Port (Assumed as default for protocol if not specified)
Path
Querystring

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜