Uniform Resource Identifier
or URI
is a string of characters that identify specific resources. URI is like an address or Social security number of an entity which can be a web page or a file or a book. URI is generally used in IT and WWW for different types of object identification.
URI Standard RFC 3986
URI is defined in RFC 3986 as a standard. URI dates back to 1990 and defined in RFC1630 it is updated regularly. With the RFC 3986, all previously URI related standards became absolute.
Uniform
means using a single form for all different types which can be used for all of them without any exception and change.
Resource
means anything which can be used as a resource or some object useful.
Identifier
means identifying the given entity or object uniquely or in a group manner according to the situation.
URI Syntax
URI provides a complete and uniform syntax where everything can be defined with complying with this syntax.
scheme://[user@password]host[:port]]path[?query][#fragment]
Scheme
is the protocol or scheme which will be used to connect or access to the resource. The scheme can be http, https, ftp, ldap, mailto, tel, telnet, ssh, etc. As we see that all of them provide a standardized protocol for communications and network transmission.
User
and Password
are optional parameters where they can be omitted according to the usage. But can be used for situations like authentication to access a restricted resource. For example, to access HTTP basic authentication protected resource we should provide the username and password.
Host
is an important part where the remote resource host is provided with this parameter. We can use IP address or domain name for the host in general but another type of host definition can be used for different cases.
Port
is optional but we can specify the port explicitly. Port is generally related to the scheme where HTTP protocol uses port number 80, https 443 by default. If the port is default one we can skip the port parameter but if different from the default we should provide it explicitly.
Path
is another important parameter where the precise location of the resource is specified on the host. The host provides the generic address or node where path provides the precise address like index.html
or /users/ismail
etc.
Query
is used to provide different types of inputs and parameters into the specified resource or path. This is especially useful for dynamic web pages to provide parameters.
Fragment
is not used so much is can be useful to specify some pages of the remote resource or path. The specific area of a web page can be specified with a fragment.
URI Examples
URI can be used to specify different objects or resources. URI is especially used for the identification of web pages, mail addresses, telnet connections, phone numbers, LDAP connections.
Http Uri
http://www.poftut.com/what-is-a-query-database-query/
http
is the protocol part which means this resource can be accessed by using the HTTP protocol.
www.poftut.com
is the host part which provides the fully qualified domain name.
what-is-a-query-database-query
is the path which specified the resource on the given host.
We can see that the resource is specified with only protocol, host and path parameters. But we can also specify this URI like below.
http://172.104.31.121/what-is-a-query-database-query/ http://172.104.31.121:80/what-is-a-query-database-query/ http://www.poftut.com:80/what-is-a-query-database-query/
Https Uri
Https is the secure version of the Http. So most of the Uri parts are the same as the Http. We will just use https
according to http
like below.
https://www.poftut.com/what-is-a-query-database-query/
https
is the protocol part which means this resource can be accessed by using the HTTPS protocol.
www.poftut.com
is the host part which provides the fully qualified domain name.
what-is-a-query-database-query
is the path which specified the resource on the given host.
We can see that the resource is specified with only protocol, host and path parameters. But we can also specify this URI like below.
https://172.104.31.121/what-is-a-query-database-query/ https://172.104.31.121:80/what-is-a-query-database-query/ https://www.poftut.com:80/what-is-a-query-database-query/
Ftp Uri
File transfer protocol or Ftp is used to download and upload files to the FTP servers.
ftp://poftut.com/linux.gz
ftp
is the protocol name
poftut.com
is the hostname
linux.gz
is the resource path which is a gzipped file named Linux.
LDAP Uri
LDAP is a protocol used to manage users, systems access and authentication. LDAP resources can be specified with Uri.
ldap://[2001:db8::7]/c=GB?objectClass?one
ldap
is the protocol name.
[2001:db8::7]
is the host which is an IPv6 address.
c=GB
is the path for the remote resource.
objectClass
and one
are the query for the specified path.
Mail Uri
Mail addresses are specified with Uri form like below. They are a bit different from HTTP and LDAP specification.
mailto:ismail.baydan@kaleinfo.com
mailto
is the protocol that is mail address for this case.
ismail.baydan
is the username of the mail user.
kaleinfo.com
is the host of the mail user.
Telnet Uri
Telnet connections can be specified with URI like below.
telnet://192.168.1.1:2323
telnet
is the protocol of the remote resource.
192.168.1.1
is the host or IP address of the resource.
2323
is the port number of the remote telnet resource where 23 is the default telnet number. But this port number is specified explicitly because it is different from 23.
File Uri
Files on a disk can be also specified with URI.
file://c:\users\presentation.ppt
file
is the protocol or type of the given resource.
c:\
is the host of the given resource which is a disk partition.
users\presentation.ppt
is the path of the given resource which also contains the file name with extension.