What is the difference between a URI, a URL and a URN?

前端 未结 30 1252
小蘑菇
小蘑菇 2020-11-22 02:18

People talk about URLs, URIs, and URNs as if they\'re different things, but they look the same to the naked eye.

W

30条回答
  •  隐瞒了意图╮
    2020-11-22 02:52

    In summary: a URI identifies, a URL identifies and locates.

    Consider a specific edition of Shakespeare's play Romeo and Juliet, of which you have a digital copy on your home network.

    You could identify the text as urn:isbn:0-486-27557-4.
    That would be a URI, but more specifically a URN* because it names the text.

    You could also identify the text as file://hostname/sharename/RomeoAndJuliet.pdf.
    That would also be a URI, but more specifically a URL because it locates the text.

    *Uniform Resource Name

    (Note that my example is adapted from Wikipedia)

提交回复
热议问题