A uniform resource identifier (URIs) identifies a resource on the web, and, as such, is the primary way to reach it. While URIs are used in web sites, human users with web browsers are not the only clients of URIs. The URIs are also used by web crawlers as they go about indexing the web, are used by users to email and share information with others, and can also be used in programs as a primary means of getting direct access to data.
URIs should be permanent, because Cool URIs don't change. Any changes should be handled by letting the server provide HTTP/1.1 Status Code Definitions such as 301 (permanent redirect) or 307 (temporary redirect).
all URIs should point to nouns.
URIs may have query parameters to identify specific items.
<a href="http://example.com/employees?id=3">Employee id 3</a> <a href="http://example.com/employees?gender=male&status=active">Active male employees</a>
<a href="http://example.com/employees?id=3">Employee id 3</a>
ajaxGet()call is triggered instead of a full browser refresh. The results of the query are received as a JSON structure. The results are used to update the appropriate portion of the web page dynamically. Additionally, site analytics are updated. Most importantly, the requested page is inserted into the browser history stack. This ensures that if the user presses the browser back button, the correct "previous" page is displayed. Finally, web crawlers are able to correctly navigate the web site by using the href property, and don't have to depend upon temporary technology hacks to view the content that would otherwise be accessible only via ajax.
On the server side there should be an accommodation made for dealing with both ajax and non-ajax requests. This would allow users to not only view the web site directly with all the dynamic feel and speed that ajax affords, but they would also be able to bookmark or email fully-formed links to others who would then be able to visit the requested page directly.
Programmatic access to the data would be via commandline use of any www commandline program or library such as
$ curl -O http://example.com/employees?gender=male&status=active
The server application would offer data in different formats. While the default data format would be JSON, appropriate data would be returned based on simply a logical extension to the URI.
$ curl -O http://example.com/employees?gender=male&status=active $ curl -O http://example.com/employees.json?gender=male&status=active
$ curl -O http://example.com/employees.xml?gender=male&status=active
$ curl -O http://example.com/employees.yml?gender=male&status=active
$ curl -O http://example.com/employees.tgz?gender=male&status=active