- URI scheme
In the field of
computer networking , a URI scheme is the top level of theUniform Resource Identifier (URI) naming structure. All URIs and absolute URI references are formed with a scheme name, followed by a colon character (":"), and the remainder of the URI called (in the outdated RFCs 1738 and 2396, but not the current STD 66/RFC 3986) "the scheme-specific part". The syntax and semantics of the scheme-specific part are left largely to the specifications governing individual schemes, subject to certain constraints such as reserved characters and how to "escape" them.URI schemes are sometimes erroneously referred to as "protocols", or specifically as URI protocols or
URL protocols, since most were originally designed to be used with a particular protocol, and often have the same name. Thehttp
scheme, for instance, is generally used for interacting with Web resources usingHyperText Transfer Protocol . Today, URIs with that scheme are also used for other purposes, such as RDF resource identifiers andXML namespaces , that are not related to the protocol. Furthermore, some URI schemes are not associated with any specific protocol (e.g. "file
") and many others do not use the name of a protocol as their prefix (e.g. "news
").URI schemes should be registered with IANA, although non-registered schemes are used in practice. RFC 4395 describes the procedures for registering new URI schemes.
Generic syntax
Internet standard [http://rfc.net/std0066.html STD 66] (also RFC 3986) defines the generic syntax to be used in all URI schemes. Every URI is defined as consisting of four parts, as follows:: [ ? ] [ # ] The scheme name consist of a letter followed by any combination of letters, digits, and the plus ("+"), period ("."), or hyphen ("-") characters; and is terminated by a colon (":").
The hierarchical part of the URI is intended to hold identification information hierarchical in nature. Usually this part begins with a double forward slash ("//"), followed by an authority part and an optional path. The authority part holds an optional user information part terminated with "@" (e.g.
), a hostname (i.e.username:password@ domain name orIP address ), and an optional port number preceded by a colon ":". The path part is a sequence of segments (conceptually similar to directories, though not necessarily representing them) separated by a forward slash ("/"). Each segment can contain parameters separated from it using a semicolon (";"), though this is rarely used in practice.The query is an optional part separated with a question mark, which contains additional identification information which is not hierarchical in nature. The
query string syntax is not generically defined, but is commonly organized as a sequence of
pairs separated by a semicolon [RFC 1866 section 8.2.1 : by Tim Berners-Lee in 1995 encourages CGI authors to support ';' in addition to '&'.] [ [http://www.w3.org/TR/REC-html40/appendix/notes.html#h-B.2.2 HTML 4.01 Specification: Implementation, and Design Notes] : "CGI implementors support the use of ";" in place of "&" to save authors the trouble of escaping "&" characters in this manner."] [ [http://www.w3.org/MarkUp/html-spec/html-spec_foot.html#FOOT26 Hypertext Markup Language - 2.0] "CGI implementors are encouraged to support the use of ';' in place of '&' " ] or separated by an ampersand, e. g.=
orkey1=value1&key2=value2&key3=value3
.key1=value1;key2=value2;key3=value3 The fragment is an optional part separated from the front parts by a hash ("#"). It holds additional identifying information that provides direction to a secondary resource, e.g. a section heading in an article identified by the remainder of the URI. When the primary resource is an
HTML document, the fragment is often a namedanchor tag .Examples
The following are two example URIs and their component parts (taken loosely from RFC 3986 — STD 66):
foo://username:password@example.com:8042/over/there/index.dtb;type=animal?name=ferret#nose / ________________/_________/ __/_________/ ___/ _/ _________/ _________/ __/
| | | | | | | |
scheme userinfo hostname port path filename extension parameter(s) query fragment
_______________________________/
authority
________________________ / / urn:example:animal:ferret:noseOfficial IANA-registered schemes
The official URI schemes registered with the IANA follow.
Unofficial but common URI schemes
External links
* [http://www.iana.org/assignments/uri-schemes.html Official IANA Registry of URI Schemes]
* [http://esw.w3.org/topic/UriSchemes/ More information, including many more schemes]
Wikimedia Foundation. 2010.