Uniform resource identifier (URI) and URL: Difference between revisions
Mr. MacKenty (talk | contribs) No edit summary |
Mr. MacKenty (talk | contribs) |
||
(18 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
[[file:Connection.png|right|frame|Web Science<ref>http://www.flaticon.com/</ref>]] | |||
< | |||
== Characteristics of a URI == | |||
</ | |||
</ | A Uniform Resource Locator (URL), is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI).<ref>https://en.wikipedia.org/wiki/URL</ref> | ||
* Please [http://www.ietf.org/rfc/rfc2396.txt?cm_mc_uid=07864784650914905194154&cm_mc_sid_50200000=1490519415 click here for the official url specification] | |||
* URL's have different parts. Every URL MUST have: | |||
** scheme, path and host | |||
* URL's have different parts. Every URL MIGHT have: | |||
** user information | |||
** port | |||
** query | |||
** fragment | |||
Please [https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Examples 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. | |||
Please [https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml#uri-schemes-1 click here to see a list of all the available schemes. There's a LOT more than HTTP and HTTPS!!] | |||
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 number. 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 number. | |||
# '''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: | |||
scheme://host:port/path?query | |||
# The scheme is followed by a colon and two forward slashes. | |||
# If a port number is specified, that number 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.<ref>https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.1.0/com.ibm.cics.ts.internet.doc/topics/dfhtl_uricomp.html</ref> | |||
== Example of a URL == | |||
The following figure displays two example URIs and their component parts. <ref> https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Examples</ref> | |||
<pre> | |||
hierarchical part | |||
┌───────────────────┴─────────────────────┐ | |||
authority path | |||
┌───────────────┴───────────────┐┌───┴────┐ | |||
abc://username:password@example.com:123/path/data?key=value&key2=value2#fragid1 | |||
└┬┘ └───────┬───────┘ └────┬────┘ └┬┘ └─────────┬─────────┘ └──┬──┘ | |||
scheme user information host port query fragment | |||
urn:example:mammal:monotreme:echidna | |||
└┬┘ └──────────────┬───────────────┘ | |||
scheme path</pre> | |||
== Purpose of a URL == | |||
== | |||
A URL is a string of characters used to identify a resource. The purpose of a URL is to easily retrieve network resources. URL's also make linking to resources easier. | |||
== Do you understand this? == | == Do you understand this? == | ||
* identify each part of this URI: | |||
<pre> | |||
file:///Users/billdagjana/Desktop/ | |||
</pre> | |||
* 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 | |||
== Standards == | == Standards == | ||
Line 73: | Line 81: | ||
[[Category:Web Science]] | [[Category:Web Science]] | ||
Latest revision as of 10:08, 28 March 2017
Characteristics of a URI[edit]
A Uniform Resource Locator (URL), is a reference to a web resource that specifies its location on a computer network and a mechanism for retrieving it. A URL is a specific type of Uniform Resource Identifier (URI).[2]
- URL's have different parts. Every URL MUST have:
- scheme, path and host
- URL's have different parts. Every URL MIGHT have:
- user information
- port
- query
- fragment
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.
Please click here to see a list of all the available schemes. There's a LOT more than HTTP and HTTPS!!
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 number. 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 number.
- 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:
scheme://host:port/path?query
- The scheme is followed by a colon and two forward slashes.
- If a port number is specified, that number 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.[3]
Example of a URL[edit]
The following figure displays two example URIs and their component parts. [4]
hierarchical part ┌───────────────────┴─────────────────────┐ authority path ┌───────────────┴───────────────┐┌───┴────┐ abc://username:password@example.com: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[edit]
A URL is a string of characters used to identify a resource. The purpose of a URL is to easily retrieve network resources. URL's also make linking to resources easier.
Do you understand this?[edit]
- identify each part of this URI:
file:///Users/billdagjana/Desktop/
- 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
Standards[edit]
These standards are used from the IB Computer Science Subject Guide[5]
- Identify the characteristics of a uniform resource identifier (URI) URL.
- Describe the purpose of a URL.
References[edit]
- ↑ http://www.flaticon.com/
- ↑ https://en.wikipedia.org/wiki/URL
- ↑ https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.1.0/com.ibm.cics.ts.internet.doc/topics/dfhtl_uricomp.html
- ↑ https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Examples
- ↑ IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.