5569RE: [rest-discuss] Correct REST principles
- Dec 1, 2005There's been a lot of discussion on this point & my opinion is that the full URI is inclusive of the query terms. The query terms are actually part of identifying the resource (I also believe the specification indicates this as well - http://www.gbiv.com/protocols/uri/rfc/rfc3986.html). The text string can be considered opaque by a lot of software applications, and other applications pull data out of portions of the URI regardless of where in that text string it is - path segments, segment parameters or query terms.
From: email@example.com [mailto:firstname.lastname@example.org] On Behalf Of Costello, Roger L.
Sent: Thursday, December 01, 2005 7:42 AM
Subject: Re: [rest-discuss] Correct REST principles> 1. Is it considered bad taste to use parameters (i.e. ?id=1) within the
> URL? From what I have read it is but everyone seems to be doing it.
This is an excellent question, and has also been a question on my mind of late.My thinking is this: The sole purpose of a URL is to "identify" a resource.Tim Berners-Lee Axiom 0: every resource on the Web shall be uniquely identified by a URL.For example, this (logical URL) identifies a 747 aircraft resource:If we agree that the sole purpose of a URL is to identify a resource, then I cannot see why a person would ever use query strings. If information needs to be passed to the resource, then you must ask "why?" Are you wishing to update a resource? If so, then you should POST the information to the resource (and the resource is identified using a logical URL without any query strings).I am eager to hear what others are thinking on this topic. /Roger
- << Previous post in topic Next post in topic >>