Examples of URI, URL and URN

前端 未结 2 1137
忘掉有多难
忘掉有多难 2020-12-10 20:04

I have read many articles about URIs, URLs and URNs, but I don\'t understand the diff in real examples.

Could you

2条回答
  •  渐次进展
    2020-12-10 20:54

    Here's a quote from the REST in Practice by J.Webber, S.Parastatidis, I.Robinson, that captures the essence of the differences:

    URLs and URN s are special forms of URIs.

    A URI that identifies the mechanism by which a resource may be accessed is usually referred to as a URL. HTTP URIs are examples of URLs.

    If the URI has urn as its scheme and adheres to the requirements of RFC 2141 and RFC 2611, it is a URN. The goal of URN s is to provide globally unique names for resources.

    The ISBN of this book is ISBN-13: 978-0596805821, by the way. If you click on the Amazon.com's link Why is ISBN important, you will see the tooltip saying:

    This bar-code number lets you verify that you're getting exactly the right version or edition of a book.

    This is an example of the URN (and URI by definition) in the urn:isbn namespace, which does not assume any given mechanism for retrieving this resource, but does identify it.

    If you had some link to the book online, for example, in PDF format, that would be a URL (and URI by definition) and look something like this:

    https://www.somewebsite.org/books/RestInPractice.pdf
    

提交回复
热议问题