Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the difference between a scheme and a protocol in a URL?

I'm hoping someone can clarify to me the technical difference between a protocol and a scheme in a url. (or identify the rest of the items that can also be placed in a scheme?)

Originally I had thought they were the same and that scheme was just another name for it.

You can find scheme referenced here in this wikipedia article.

Although according to an answer here a scheme is not considered to be a protocol because:

there is no transport layer or encoding

Is this the proper way that defines their difference or is there more to it that makes the two different?

How can I distinctly tell when I'm dealing with a protocol or scheme? (or something other than a protocol that also qualifies to be used in a scheme? since it seems that protocols get placed in the scheme part of a url)

like image 490
Jonathan002 Avatar asked Feb 23 '18 17:02

Jonathan002


People also ask

What does scheme mean in URL?

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.

Is HTTP a scheme?

In the examples used, scheme names are lowercase, and protocol names are uppercase. Thus, http is a scheme and HTTP refers to (either version of the) HTTP protocol.

Is scheme mandatory in URL?

This is a valid URL. It's called a "network-path reference" as defined in RFC 3986. When you don't specify a scheme/protocol, it will fall back to the current scheme. So if you are viewing a page via https:// all network path references will also use https.

What are the various types of URL schemes?

There are two types of URL: Absolute URL. Relative URL.


1 Answers

My understanding is that the two terms have a significant overlap. The protocol being the agreed upon method of information transfer and the scheme being the identifier that URLs use to express what type of protocol the specific resource should be served over. In short, schemes are simply identifiers for protocols.

For example

In the link https://example.com, https is the scheme that tells the browser (or whoever the requester of that resource is) that the resource at example.com will be served over the Hypertext Transfer Protocol Secure (HTTPS), which is the type of "protocol".

Scheme <> Protocol

ftp <> File Transer protocol http <> Hypertext Transfer Protocol https <> Hypertext Transfer Protocol Secure 
like image 111
clayjones94 Avatar answered Oct 12 '22 11:10

clayjones94