URI、URL 和 URN 的示例 [英] Examples of URI, URL and URN

查看:20
本文介绍了URI、URL 和 URN 的示例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经阅读了很多关于 URIs、URLs 和 URNs 的文章,但我不明白实际示例中的差异.

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

您能举几个 URIURL 的例子吗?

Could you take a few examples of URI and URL?

我认为 http://stack.com/first/index.html?submit=yes&action=go#second 是 URI,而不是 URL,是吗?

I think http://stack.com/first/index.html?submit=yes&action=go#second is URI, not URL, yes?

那么http://stack.com/first/index.html就是URL,因为不是那么具体?

Then http://stack.com/first/index.html is URL, because it's not so specific?

这张图片是否正确?

推荐答案

这里引用了 J.Webber、S.Parastatidis、I.Robinson 的 REST in Practice,它抓住了差异:

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

URL 和 URN 是 URI 的特殊形式.

URLs and URN s are special forms of URIs.

一个 URI,标识可以访问资源的机制通常被称为作为网址.HTTP URI 是 URL 的示例.

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.

如果 URI 有 urn 作为它的方案并遵守RFC 2141的要求RFC 2611,它是一个URN.URN 的目标是提供全局唯一的名称资源.

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.

顺便说一下,这本书的 ISBN 是 ISBN-13:978-0596805821.如果您单击 Amazon.com 的链接为什么 ISBN 很重要",您将看到工具提示:

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.

这是 urn:isbn 命名空间中的 URN(以及定义的 URI)的一个示例,它不假定任何用于检索此资源的给定机制,但会识别它.

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.

如果您有一些指向该在线图书的链接,例如 PDF 格式,则该链接将是一个 URL(根据定义为 URI),如下所示:

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

这篇关于URI、URL 和 URN 的示例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆