Das Video kommt von YouTube: erst beim Abspielen verbindet sich die Seite mit YouTube (Google).
URIs, URLs, and URNs | Difference between URI and URL | URL Explained
Das Wichtigste aus dem Video
Tipp auf eine Zeit – das Video springt genau dorthin.
Transkriptautomatisch erstellt · 45 Zeilen
- Hey, what's going on guys? It's me again, Eub from the webdev cave. Welcome back to a new video and new step towards the expertise. In this short video, I
- will talk about URIs, URLs and your ends because I see a lot of confusion between the three. In fact, I used to confuse between them and they cause me a lot of
- headache and I don't want you to go through that. Learning about these three terms and the difference between them can be quite useful on the long run. So
- what do these three acronyms stand for and what do they mean? What is the difference between them and why does it matter? Let's start by defining each one
- of them. The URI stands for uniform resource identifier and it is a string of characters used to identify a resource on the internet either by
- location or by name or both. For example, let's say we want to get to a friend. His name is Flank Sidesmack. Okay, that's not a name but yeah. and
- this is his address. To actually do that, we need to use either his name or his address. Think of the URI as using the name or the address to identify the
- person we want to get to. And of course, we can use both in the same time. Whether we use just one or both, in both cases, it is a URI. It is a way to
- identify the resource. We will come back to the URI later. Now, a URL stands for uniform resource locator and it is pretty self-explanatory, right? It is
- also a string of characters, but it refers to just the address, just the location of the resource and it is the most used way to locate resources on the
- web. For example, in our case, we can identify our friend by just using his location. A UR instead stands for uniform resource. Can you guess that?
- Yeah. Name. Uniform resource name. And now this should be obvious to you. It is the name of the resource. Again, in our case, if we want to locate our friend
- using a URN, we will use his name flank sides smack. I really love his name actually. Now, I don't know if you can see it or not. Maybe now you're
- wondering about it. And that is if URIs can specify the name and the location of the resource we are looking for. As we said, one of them or both at the same
- time. And URLs use just the location while URS indicate just the name. Then technically a URI is either a URL or a UR right therefore every URL and every
- URL is a URI right well that's true because back in the mid90s in the creation of web identifiers URIs were split into two classes URIs that specify
- the location and those that specify the name. And to avoid the confusion about whether a URI is specifying the name or the location, URIs that specify the
- location were called URLs, uniform resource locators. And that's what we use in web browsers actually when we want to get a web page. And URIs that
- specify the name were called URN. An identifier that specify both the name and the location is called of course a URI. Since two or more resources can
- have the same name, it is ineffective to use URLs to identify and locate resources. Thus, almost all the time, we use URLs to do that. And because we use
- URLs most of the time, let's talk about them in a little more detail. In order to allow clients to request resources from servers, HTTP messages need to be
- sent to the server holding the URL. You may want to watch my video about the HTTP in the web to see how that happens. Well, how can we send an HTTP message?
- We do that by typing the URL in the browser and hitting enter. Let's see how does a URL look like? A URL consists of two required components. The protocol
- used to connect and the domain or the IP address to connect to. You can see a URL that has other than these information, but that's optional such as the path
- which locate the file or the directory in the server. And you can also see the port and other components that we will see in a few. Let's bring a URL, dissect
- it, and explain what each part does. The first part is the protocol we're using, which is of course HTTP or HTTPS. If we are looking for resources on the web, we
- can use different protocols. For example, if we want to share files on the internet, we use the FTP protocol. The second part is the domain. The
- domain is the name that the domain name server gives to a unique IP address. So, we can use either the name or the IP address. For example, my website.com has
- the IP address 111.222.33.444 and the domain in the URL is case insensitive. An optional attribute is
- the port and if any, it should be after the domain preceded by a colon. You may wonder what a port is. Simply put, a port is a type of software connection
- point used by the TCP IP protocol and the connecting computer. Think of that as two persons want to meet and two parallel walls are between them. Each
- wall has the same number of doors as the other one and each door is facing its opposite visav and lead just to it. In order to meet the two persons should
- open the same door in each wall. This is the same principle as the port in a URL. By specifying a port number, we are telling the server from which port our
- request is coming and from which should be received. By default, every protocol has its default port number. So if we didn't specify the port number, it's
- actually the same as using the default and it doesn't appear on the URL. For example, the HTTP default port is 80. If we want to connect to the server via
- different port, we should specify that. For example, in this case, we are trying to connect through the port 888. The next part of the URL is the path and it
- is optional. This is a familiar concept to anyone who has ever used a computer file system. It looks like this. And this is a way to locate the resource on
- the server. There can be other parts which are query strings and fragments. Query strings are a way of passing information from the client to the
- server such as entering information in user form input. They are preceded by a question mark and they are encoded as key value pairs delimited by a number
- symbol. And this is an example of that. Fragments are always at the end of the URL. You can identify a fragment by the hash symbol before it. They are used as
- a way of requesting a portion of a page. Browsers will see the fragment tag anchor in the HTML code and scroll the website down to it. For example, this is
- a URL that contains a fragment from the Wikipedia website. To sum up, we've seen that we use URIs, URLs or URNs to identify resources and URIs can specify
- the address or the name of the resource or both at the same time. We usually use URLs to identify resources and a URL consists of required components which
- are the protocol and the domain and optional ones and they are the port, the path, query strings and fragments. So there you have it. No headaches anymore.
- I hope you find this video useful and you've learned something from it. Till the next video, keep learning and of course stay tuned.
Zum Nachlesen
Uniform Resource IdentifierEin Uniform Resource Identifier (Abk. URI; englisch für „einheitlicher Bezeichner für Ressourcen“) ist ein Identifikator und besteht aus einer Zeichenfolge, …
Uniform Resource LocatorEin Uniform Resource Locator (Abk. URL; englisch für „einheitlicher Verorter für Ressourcen“) identifiziert und lokalisiert eine Ressource, …
FragmentbezeichnerAls Fragmentbezeichner (englisch fragment identifier) ist ein optionaler Teil eines URI und wird dazu benutzt, eine Untereinheit oder einen Teil einer Ressource …
Uniform Resource NameAufbau. Bearbeiten. Syntax-Diagramm. URNs sind URIs mit dem Schema urn . Der Schema-spezifische Teil des URIs ist weiter in Namensräume (NIDs, Namespace …