Re: Does idempotence include the response codes?

Hi Julian,

On Tue, Oct 15, 2013 at 08:05:24PM +0200, Julian Reschke wrote:
> On 2013-10-15 19:43, cowwoc wrote:
> >Hi,
> >
> >     Can the authors officially weigh in on the meaning of "idempotent"
> >with response to response codes? Do idempotent methods have to return
> >the same response code in the face of multiple invocations? Or are they
> >allowed to return different response codes so long as the state is not
> >modified by subsequent requests? See
> >http://stackoverflow.com/q/741192/14731 for the discussion that fueled
> >this question.
> 
> I'll repeat what I said over there:
> 
> No, "effect" is not intended to cover the response as well. What you 
> propose is that DELETE either always must pass ("200") or fail ("404" or 
> "410"), no matter what the state of the server is. This doesn't make any 
> sense and furthermore doesn't help the client at all.
> 
> >     PS: It would be nice if the spec officially clarified this point as
> >I've seen it brought up again and again in different discussions.
> 
> I personally believe it's clear enough, as the other interpretation 
> frankly doesn't make any sense.
> 
> That being said, what do others think?

While my understanding has always been that the effect is considered on
the server only, this question made me re-read the definition in p2-4.2.2.

And trying to read it with the other meaning in mind, I find nothing which
tells me I'm wrong :

   Request methods are considered "idempotent" if the intended effect of
   multiple identical requests is the same as for a single request.  Of
   the request methods defined by this specification, the PUT, DELETE,
   and safe request methods are idempotent.

   [the 2 other paragraphs do not prove me wrong either]

For example, people working on a client could easily consider the effect
as "the effect on my client". I guess it would remove that question if we
just add "on the server" after "effect" to remove this possible ambiguity.

Maybe your example about DELETE returning 200 then 404 or 410 would also
be nice to add at the end of the first paragraph quoted above.

Best regards,
Willy

Received on Tuesday, 15 October 2013 18:15:01 UTC