

{"id":105398,"date":"2021-12-18T09:00:51","date_gmt":"2021-12-18T03:30:51","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=105398"},"modified":"2021-12-18T12:52:18","modified_gmt":"2021-12-18T07:22:18","slug":"uri-vs-url","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/","title":{"rendered":"URI vs URL"},"content":{"rendered":"<p>In this article, we will learn what is URI, what is URL and URI vs URL. Let&#8217;s start!!!<\/p>\n<h3>What is a URI?<\/h3>\n<p>A URI, or Uniform Resource Identifier, is a string identifier that refers to an internet resource. It is a string of characters used to identify any resource on the internet based on its location, name, or both.<\/p>\n<p>A URI has two subsets: URL (Uniform Resource Locator) and URN (Uniform Resource Name) (Uniform Resource Number). If it only contains a name, it is not a URL. In the real world, we mostly see URLs and URNs rather than direct URIs.<\/p>\n<p>HTTP, HTTPs, ftp, Idap, telnet are common URI schemes.<\/p>\n<h3>URI Syntax:<\/h3>\n<h4>1. Scheme:<\/h4>\n<p>Scheme can be any combination of letter, digit, plus sign, or hyphen (-), followed by a colon (:). The most common protocols are http, file, ftp, data, and irc. The schemes must be registered with the Internet Assigned Numbers Authority (IANA).<\/p>\n<h4>2. Authority:<\/h4>\n<p>The authority component is optional and is denoted by two forward slashes (\/).<\/p>\n<ul>\n<li>userinfo: It may include a username and, optionally, a password separated by a colon. The @ symbol comes after the sub-component.<\/li>\n<li>host: It either has a registered name or an IP address. The IP address must be surrounded by [] brackets.<\/li>\n<li>port: Optional<\/li>\n<\/ul>\n<h4>3. Path:<\/h4>\n<p>It is made up of a series of path segments separated by a slash(\/). It is always specified by the URI; however, the specified path may be empty or of 0 length.<\/p>\n<h4>4. Query:<\/h4>\n<p>It is an optional component, denoted by a question mark (?). It contains a non-hierarchical query string.<\/p>\n<h4>5. Fragment:<\/h4>\n<p>It is also an optional component that is preceded by the hash(#) symbol. It is made up of a fragment identifier that points to a secondary resource.<\/p>\n<p>Example of URI: news:comp.infosystems.www.servers.unix<\/p>\n<h3>What is a URL?<\/h3>\n<p>A URL, or Uniform Resource Locator, is used to locate a resource on the internet. It is a resource reference as well as a method of accessing that resource. A URL always represents a unique resource, which could be an HTML page, a CSS document, an image, or something else.<\/p>\n<p>A URL accesses a resource via a protocol, which can be HTTP, HTTPS, FTP, or others.<\/p>\n<p>It is primarily referred to as the website&#8217;s address, which a user can find in their address bars.<\/p>\n<h3>URL Syntax:<\/h3>\n<h4>1. Scheme:<\/h4>\n<p>The first component of the URL is a scheme, which represents a protocol that a browser must use to request the resource. HTTP or HTTPS are the most commonly used protocols for websites.<\/p>\n<h4>2. Authority:<\/h4>\n<p>The authority consists of two sub-components, separated by a colon: domain name and Port. The domain name can be anything, and the port is the technical gate through which the resource is accessed on a web server. HTTP is accessed via port 80, while HTTPS is accessed via port 443.<\/p>\n<h3>3. Path:<\/h3>\n<p>The path specifies the full path to the web server resource. It could be something like \/software\/htp\/index.html.<\/p>\n<h4>4. Query String:<\/h4>\n<p>The name and value pair are contained in the string. When used in a URL, it follows the path component and provides the information. For example, &#8220;?key1=value1&amp;key2=value2&#8221;.<\/p>\n<h4>5. Fragment:<\/h4>\n<p>It is also an optional component that is preceded by the hash(#) symbol. It is made up of a fragment identifier that points to a secondary resource.<\/p>\n<h3>Difference between URI vs URL:<\/h3>\n<p>1. URI contains both URL and URN to identify a resource&#8217;s name and location or both; URL, on the other hand, is a subset of URI and only identifies the resource&#8217;s location.<br \/>\n2. The URI example is urn:isbn:0-476-27557-4, while the URL example is https:\/\/google.com.<br \/>\n3. We can use URI to locate resources in HTML, XML, and other files, whereas we can use URL to find a web page.<br \/>\n4. Each URL can be a URI, but not all URIs can be URLs.<\/p>\n<h3>Comparison between URI and URL:<\/h3>\n<table>\n<tbody>\n<tr>\n<td><b>URI<\/b><\/td>\n<td><b>URL<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">URI is an abbreviation for Uniform Resource Identifier.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The term URL is short for Uniform Resource Locator.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">URN, which tells the name, and URL, which tells the location, are two subsets of URI.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">URL specifies the resource&#8217;s unique location, and is a subset of URI.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">All URIs cannot be URLs because they can indicate either a name or a location.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Because every URL can only contain the location, all URLs are URIs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">A URI attempts to identify and distinguish a resource from other resources by using the resource&#8217;s name or location.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">A URL seeks to locate or address a resource on the internet.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ISBN 0-486-35557-4 is an example of a URI.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">https:\/\/data-flair.training\/ is an example of a URL.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">It identifies resources and binaries in XML and tags library files such as JSTL and XSTL.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It is useful to search the internet for web pages.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">A URI scheme can be a protocol, a designation, a specification, or anything else.<\/span><\/td>\n<td><span style=\"font-weight: 400;\">The URL scheme is typically a protocol such as HTTP, HTTPS, FTP, and so on.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>Summary:<\/h3>\n<p>In this article, we looked at the concept of URI and URL, and also the syntax of each. We looked at the differences between URI and URL, and also a tabular comparison between URI and URL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this article, we will learn what is URI, what is URL and URI vs URL. Let&#8217;s start!!! What is a URI? A URI, or Uniform Resource Identifier, is a string identifier that refers&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":105399,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24974],"tags":[26101,26093,26100],"class_list":["post-105398","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-computer-network","tag-uri-syntax","tag-uri-vs-url","tag-url-syntax"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>URI vs URL - DataFlair<\/title>\n<meta name=\"description\" content=\"Learn about URI and URL with their syntax. See differences between URI vs URL, and also a tabular comparison between URI and URL.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/uri-vs-url\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"URI vs URL - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Learn about URI and URL with their syntax. See differences between URI vs URL, and also a tabular comparison between URI and URL.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/uri-vs-url\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-18T03:30:51+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-12-18T07:22:18+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"URI vs URL - DataFlair","description":"Learn about URI and URL with their syntax. See differences between URI vs URL, and also a tabular comparison between URI and URL.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/","og_locale":"en_US","og_type":"article","og_title":"URI vs URL - DataFlair","og_description":"Learn about URI and URL with their syntax. See differences between URI vs URL, and also a tabular comparison between URI and URL.","og_url":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-12-18T03:30:51+00:00","article_modified_time":"2021-12-18T07:22:18+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp","type":"image\/webp"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"URI vs URL","datePublished":"2021-12-18T03:30:51+00:00","dateModified":"2021-12-18T07:22:18+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/"},"wordCount":867,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp","keywords":["URI Syntax","URI vs URL","URL Syntax"],"articleSection":["computer network tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/uri-vs-url\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/","url":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/","name":"URI vs URL - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp","datePublished":"2021-12-18T03:30:51+00:00","dateModified":"2021-12-18T07:22:18+00:00","description":"Learn about URI and URL with their syntax. See differences between URI vs URL, and also a tabular comparison between URI and URL.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/uri-vs-url\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/12\/uri-vs-url.webp","width":1200,"height":628,"caption":"uri vs url"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/uri-vs-url\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"computer network tutorial","item":"https:\/\/data-flair.training\/blogs\/category\/computer-network\/"},{"@type":"ListItem","position":3,"name":"URI vs URL"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/105398","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=105398"}],"version-history":[{"count":4,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/105398\/revisions"}],"predecessor-version":[{"id":106860,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/105398\/revisions\/106860"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/105399"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=105398"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=105398"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=105398"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}