URI schemes
Thescheme of a URI is the first part of the URI, before the: character.It indicates which protocol the browser must use to fetch the resource.The scheme may affect how the rest of the URI is structured and interpreted.
In this article
Syntax
protocol:protocolA sequence of characters that identifies the protocol to use.It should consist of only alphanumeric characters and the
+,-, and.characters.Common schemes are:blobBinary Large Object; a pointer to a large in-memory object
dataData directly embedded in the URL
fileHost-specific file names
ftp- File Transfer Protocol
http/httpsHypertext Transfer Protocol (and secure connections)
javascriptURL-embedded JavaScript code
mailtoElectronic mail address
resourceNon-standardFor Firefox and Firefox browser extensions to load internal resources
sshSecure shell
telTelephone
urnUniform Resource Names
view-sourceSource code of the resource
ws/wssWebSocket connections (and secure connections)
Description
Consider the following URL:
http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2#SomewhereInTheDocumenthttp is thescheme of the URL, indicating which protocol the browser must use. Usually it is the HTTP protocol or its secured version, HTTPS. The Web requireshttp orhttps, but browsers can open URIs with other schemes, like those that start withmailto: (to open a mail client) orftp: (file transfers).
When using URLs inHTML content, you generally only use a few of these URL schemes. When referring to subresources — that is, files that are being loaded as part of a larger document — you should only use the HTTP and HTTPS schemes. Increasingly, browsers are removing support for using FTP to load subresources, for security reasons.
FTP is still acceptable at the top level (such as typed directly into the browser's URL bar, or the target of a link), although some browsers may delegate loading FTP content to another application.
Examples
>Different URI schemes
The following example shows different URI formats based on URI scheme.
tel:+1-816-555-1212git@github.com:mdn/browser-compat-data.gitftp://example.org/resource.txturn:isbn:9780141036144mailto:help@supercyberhelpdesk.infoSpecifications
| Specification |
|---|
| Unknown specification> # section-3.1> |