Uniform resource identifier (URI) and URL: Difference between revisions

From Computer Science Wiki
 
(6 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{#incat:Not_yet|
<center>
<blockquote style="padding: 5px; background-color: #FFF8DC; border: solid thin gray;">
  [[File:Exclamation.png]] This page is not ready for student learning. It may have been created by a student, used as a placeholder by the teacher, or the teacher hasn't had time to review it.
</blockquote>
</center>
|}}
[[file:Connection.png|right|frame|Web Science<ref>http://www.flaticon.com/</ref>]]
[[file:Connection.png|right|frame|Web Science<ref>http://www.flaticon.com/</ref>]]


Students will be expected to not only define, but also discuss the characteristics of URL and URI. Students will also be expected to describe the purpose of a URL.
== Characteristics of a URI ==
 
== Characteristics of a URL ==




Line 20: Line 9:


* URL's have different parts. Every URL MUST have:
* URL's have different parts. Every URL MUST have:
** scheme and host
** scheme, path and host
* URL's have different parts. Every URL MIGHT have:
* URL's have different parts. Every URL MIGHT have:
** user information     
** user information     
Line 28: Line 17:


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://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 ==
== Example of a URL ==
Line 58: Line 66:


* Which one of these does a URI NOT do:  
* Which one of these does a URI NOT do:  
** Enable easier access to resources
** Enable easier access to resources
** Provide excellent resources for linking between resources
** Provide excellent resources for linking between resources
Line 74: Line 81:


[[Category:Web Science]]
[[Category:Web Science]]
[[Category:not yet]]

Latest revision as of 10:08, 28 March 2017

Web Science[1]

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:

  1. 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).
  2. 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.
  3. 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.
  4. 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
  1. The scheme is followed by a colon and two forward slashes.
  2. If a port number is specified, that number follows the host name, separated by a colon.
  3. The path name begins with a single forward slash.
  4. 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]

  1. http://www.flaticon.com/
  2. https://en.wikipedia.org/wiki/URL
  3. https://www.ibm.com/support/knowledgecenter/en/SSGMCP_5.1.0/com.ibm.cics.ts.internet.doc/topics/dfhtl_uricomp.html
  4. https://en.wikipedia.org/wiki/Uniform_Resource_Identifier#Examples
  5. IB Diploma Programme Computer science guide (first examinations 2014). Cardiff, Wales, United Kingdom: International Baccalaureate Organization. January 2012.