Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 892
Matthew Avatar asked May 16 '11 19:05

Matthew


2 Answers

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
like image 194
Gumbo Avatar answered Sep 28 '22 15:09

Gumbo


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

like image 40
FatherStorm Avatar answered Sep 28 '22 13:09

FatherStorm