openfrog
openfrog

Reputation: 40765

Is it right to say that paths are represented as URI while web-addresses are represented as URL?

I am confused by Apple's documentation about the NSURL class.

In NSURL, they say the following:

Also they say that the RFC 2396 URI are paths.

Now what's the difference here? Isn't a path also an URL? I mean, it's an location or not?

Upvotes: 0

Views: 245

Answers (1)

Jamey Hicks
Jamey Hicks

Reputation: 2370

Both URLs and URIs identify resources (which are anything). However, a URL is the term used for an identifier that specifies how to locate the resource.

Let's consider other kinds of identifiers to help make this clear. An ISBN code identifies a book but does not specify how to find it. A Dewey Decimal or Library of Congress number also identifies a book and is also used to organize books in a library -- given the number you can find the book on a shelf in the library.

Getting back to URIs and URLs, a URI that refers to the location or path of a file is by definition a URL.

NSURL can also be used to parse and manipulate URIs that do not locate resources but merely identify them.

Upvotes: 4

Related Questions