is `www.me.com/page.php` and `www.me.com/page.php?

2019-08-21 08:01发布

From the page http://msdn.microsoft.com/en-us/magazine/dd315413.aspx:

User agents interact with resources, and resources are anything that can be named and represented. Each resource can be addressed via a unique Uniform Resource Identifier (URI).

is www.me.com/page.php and www.me.com/page.php?1 and www.me.com/page.php?2 considered 3 unique URIs ?

I know they are interpreted as different urls. But are they unique in the sense according to the RESTful definition: each resource is accessed through a unique URI

4条回答
祖国的老花朵
2楼-- · 2019-08-21 08:39

"Each resource can be addressed via a unique Uniform Resource Identifier (URI)". This line clear said that all those are unique URI. Because for the first URI you are calling default resource. For the later two you are calling resource with specific id.

查看更多
Fickle 薄情
3楼-- · 2019-08-21 08:46

yes. they are interpreted as different urls. you can have for example shop.php?product=1 and shop.php?product=2. Each url shows a different product.

查看更多
Ridiculous、
4楼-- · 2019-08-21 08:47

Yes, they are. The query string is part of the URI.

查看更多
男人必须洒脱
5楼-- · 2019-08-21 08:54

The answer is they are unique URLs, but different URLs could refer to the same entity:

This article might help: http://en.wikipedia.org/wiki/Uniform_Resource_Name

URL's are resource locators, there is nothing to say they must point at different "things", they usually do, but not always.

URN's are meant to be unique identifiers, but again, you could have two URNs pointing to the same book using different ID's

查看更多
登录 后发表回答