{"id":459,"date":"2021-12-08T15:29:16","date_gmt":"2021-12-08T15:29:16","guid":{"rendered":"https:\/\/demo.wpartisan.net\/developmentsite\/what-is-uris-urls-and-urns-and-what-is-the-difference-between-uri-and-url\/"},"modified":"2024-11-04T04:25:30","modified_gmt":"2024-11-04T04:25:30","slug":"what-is-uris-urls-and-urns-and-what-is-the-difference-between-uri-and-url","status":"publish","type":"post","link":"https:\/\/demo.wpartisan.net\/developmentsite\/what-is-uris-urls-and-urns-and-what-is-the-difference-between-uri-and-url\/","title":{"rendered":"What is URIs, URLs, and URNs and what is the difference between URI and URL."},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>Clear understanding about URIs, URLs, and URNs can be quite useful in the long run.<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>URI<\/strong> = Uniform Resource Identifier ( It is a string of characters used to identify a resource on the internet either by location or by name or both. )<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>URL<\/strong> = Uniform Resource Locator ( It is a string of characters but it refers to just the address(location of the resource) . It is the most used way to locate resources on the web. )<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>URN<\/strong> = Uniform Resource Name ( It is the name of the resource.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">So technically URI is either URL or URN. Therefor every URL or every URN is a URI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>To avoid the confusion lets see examples and uses:<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A URL( what we use in the web browser actually to get a web page or image ) consists of two required components : <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-&gt;The protocol <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">-&gt;The domain.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Other optional components like path, port number, query strings and fragment.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Ex: https:\/\/www.example.com\/products\/product.php?id=1#details<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here https is the protocol, www.example.com is the domain name, products\/product.php is the path, id=1 is the query string and #details is the fragment<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity \\&quot;wp-block-separator\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">Whenever we deal with rest web services, we comes with the term URI. Whenever any rest base web service is running in server, to identify this web service whatever we use is called URI<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example of REST Web Service:<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Without parameter<br>https:\/\/wpartisan.net\/wp-json\/wp\/v2\/posts<br>With parameter<br>https:\/\/wpartisan.net\/wp-json\/wp\/v2\/posts\/?categories=11<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To sum up<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We use URIs, URLs, and URNs to identify the resource<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Here I will talk about URIs, URLs and URNs because I see a lot of confusion between the three. In fact, I used to confuse them, and they caused me a lot of headaches, and I don\\&#8217;t want you to go through that.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_uag_custom_page_level_css":"","site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"set","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"footnotes":""},"categories":[15],"tags":[39],"class_list":["post-459","post","type-post","status-publish","format-standard","hentry","category-php","tag-url"],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false},"uagb_author_info":{"display_name":"WPArtisan","author_link":"https:\/\/demo.wpartisan.net\/developmentsite\/author\/developmentsiteauth\/"},"uagb_comment_info":0,"uagb_excerpt":"Here I will talk about URIs, URLs and URNs because I see a lot of confusion between the three. In fact, I used to confuse them, and they caused me a lot of headaches, and I don\\'t want you to go through that.","_links":{"self":[{"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/comments?post=459"}],"version-history":[{"count":1,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":2291,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/posts\/459\/revisions\/2291"}],"wp:attachment":[{"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/media?parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/categories?post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/demo.wpartisan.net\/developmentsite\/wp-json\/wp\/v2\/tags?post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}