Uniform resource identifier (URI) and URL
Characteristics of a URI
A Uniform Resource Locator (URL), is a reference to a web resource that specifies its location on a computer networka group or system of interconnected people or things. and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI).
- URL's have different parts. Every URL MUST have:
- scheme, path and host
- URL's have different parts. Every URL MIGHT have:
- user information
Please click here for an example of these different parts. In your normal day-to-day use, you probably only use a scheme and a host.
A URL for HTTP (or HTTPS) is normally made up of three or four components:
- A scheme. The scheme identifies the protocol to be used to access the resource on the Internet. It can be HTTP (without SSL) or HTTPS (with SSL).
- A host. The host name identifies the host that holds the resource. For example, www.example.com. A server provides services in the name of the host, but hosts and servers do not have a one-to-one mapping. Refer to Host names. Host names can also be followed by a port numberA unit of abstract mathematical system subject to the laws of arithmetic.. Refer to Port numbers. Well-known port numbers for a service are normally omitted from the URL. Most servers use the well-known port numbers for HTTP and HTTPS , so most HTTP URLs omit the port numberA unit of abstract mathematical system subject to the laws of arithmetic..
- A path. The path identifies the specific resource in the host that the web client wants to access. For example, /software/htp/cics/index.html.
- A query string. If a query string is used, it follows the path component, and provides a string of information that the resource can use for some purpose (for example, as parameters for a search or as data to be processed). The query string is usually a string of name and value pairs; for example, term=bluebird. Name and value pairs are separated from each other by an ampersand (&); for example, term=bluebird&source=browser-search.
The scheme and host components of a URL are not defined as case-sensitive, but the path and query string are case-sensitive. Typically, the whole URL is specified in lowercase.
The components of the URL are combined and delimited as follows:
- The scheme is followed by a colon and two forward slashes.
- If a port numberA unit of abstract mathematical system subject to the laws of arithmetic. is specified, that numberA unit of abstract mathematical system subject to the laws of arithmetic. follows the host name, separated by a colon.
- The path name begins with a single forward slash.
- If a query string is specified, it is preceded by a question mark.
Example of a URL
The following figure displays two example URIs and their component parts. 
hierarchical part ┌───────────────────┴─────────────────────┐ authority path ┌───────────────┴───────────────┐┌───┴────┐ abc://username:firstname.lastname@example.org:123/path/data?key=value&key2=value2#fragid1 └┬┘ └───────┬───────┘ └────┬────┘ └┬┘ └─────────┬─────────┘ └──┬──┘ scheme user information host port query fragment urn:example:mammal:monotreme:echidna └┬┘ └──────────────┬───────────────┘ scheme path
Purpose of a URL
A URL is a string of characters used to identifyProvide an answer from a number of possibilities. Recognize and state briefly a distinguishing fact or feature. a resource. The purpose of a URL is to easily retrieve networka group or system of interconnected people or things. resources. URL's also make linking to resources easier.
Do you understand this?
- identifyProvide an answer from a number of possibilities. Recognize and state briefly a distinguishing fact or feature. each part of this URI:
- Which one of these does a URI NOT do:
- Enable easier access to resources
- Provide excellent resources for linking between resources
- Allow you to more quickly download content
- Provide a unified syntax to access remote resources
These standards are used from the IB Computer Science Subject Guide
- IdentifyProvide an answer from a number of possibilities. Recognize and state briefly a distinguishing fact or feature. the characteristics of a uniform resource identifier (URI) URL.
- DescribeGive a detailed account or picture of a situation, event, pattern or process. the purpose of a URL.
- IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.