Re: URI Patterns and pattern ordering

2007-05-23 Thread Philip Johnson
Adam Taft adam at adamtaft.com writes:

 Is there a particular reason why you are using query string parameters 
 for your post attributes?

Hmm, I guess there's two issues here:

 (1) Is my example appropriate according to REST architectural principles?
 (2) How do you do order-independent multiple parameter processing in Restlet?

You make good points about (1), and I will ponder them.  I am still interested
in the answer to question (2), since I assume that we all agree that REST
architectural principles do not exclude the use of multiple query string
parameters in all situations.

Cheers,
Philip






Re: URI Patterns and pattern ordering

2007-05-23 Thread John D. Mitchell

On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:
[...]

I tend to think of query string parameters as optional parameters, and
usually only used for GET requests.


I totally agree that they are for optional parameters.

However, I find them useful for optional stuff for non-GET requests, too.

FWIW,
John


Re: URI Patterns and pattern ordering

2007-05-23 Thread Adam Taft



John D. Mitchell wrote:

IIUC your need, the user ID should be in the URL proper since that's
what is used to identify the specific resource. I.e.,
/users/johnm/...


Right, that's actually a good point.  It's possible that the best url 
scheme for the original poster is someting like:


/users/[EMAIL PROTECTED]/

If the email address is going to be used as the primary key (or at least 
a candidate key), then the above should work.  In this case, to delve 
into the semantics a little, it should probably be a PUT rather than a 
POST (since the key is known ahead of time).


Adam


Re: URI Patterns and pattern ordering

2007-05-23 Thread John D. Mitchell

On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:

John D. Mitchell wrote:

[...]

 However, I find them useful for optional stuff for non-GET requests, too.

Do you have a use case for this?  I'm genuinely curious.


?output={html,xhtml,json,etc.}

It's optional in the sense that it's identifying the same resource but
in different output formats.

Take care,
John


Re: URI Patterns and pattern ordering

2007-05-23 Thread Adam Taft



John D. Mitchell wrote:

On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:

John D. Mitchell wrote:

[...]
 However, I find them useful for optional stuff for non-GET requests, 
too.


Do you have a use case for this?  I'm genuinely curious.


?output={html,xhtml,json,etc.}

It's optional in the sense that it's identifying the same resource but
in different output formats.


Right, but that's for a GET request.  When are you specifying that for a 
POST, PUT or DELETE?


Again, I'm just trying to understand a use case for query strings in a 
POST/PUT/DELETE.  I can't see it currently.


Adam


Re: URI Patterns and pattern ordering

2007-05-23 Thread John D. Mitchell

Same thing.  I.e., I want the result of the POST to be given in
various output formats, too.

John

On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:



John D. Mitchell wrote:
 On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:
 John D. Mitchell wrote:
 [...]
  However, I find them useful for optional stuff for non-GET requests,
 too.

 Do you have a use case for this?  I'm genuinely curious.

 ?output={html,xhtml,json,etc.}

 It's optional in the sense that it's identifying the same resource but
 in different output formats.

Right, but that's for a GET request.  When are you specifying that for a
POST, PUT or DELETE?

Again, I'm just trying to understand a use case for query strings in a
POST/PUT/DELETE.  I can't see it currently.

Adam



Re: URI Patterns and pattern ordering

2007-05-23 Thread John D. Mitchell

On 5/23/07, Adam Taft [EMAIL PROTECTED] wrote:
[...]

The result of a successful POST should always and only be a HTTP 201
Created status.  Included with this response will be a Location header
to the newly created resource.  From there, you perform a GET to the uri
specified in the location header (and of course can specify the output
query string option then).


You still do that and return a useful body in the format they
requested. Get the best of both worlds.

Take care,
John The anti-fanatic :-) Mitchell