[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NEWRESOURCE




That's true and I should have pointed it out -- not everybody's aware how that works. There is still a slight issue when the client doesn't care what name to provide a new resource so long as it's unique. However as you say, a new method may not be needed if clients are willing to follow some random, sequential, or statistically-unique naming scheme, and deal with the failure case of a collision by choosing a new one.


Lisa

On Jun 16, 2004, at 9:56 AM, Mark Nottingham wrote:


I'm all for creating new methods when it's appropriate, but I'm not sure we're there yet. If your use case is the client wanting to control the URI, whilst avoiding collisions, HTTP already provides this capability:


---8<---
PUT /foo/bar/boo HTTP/1.1
Host: www.example.org
If-None-Match: *
Content-Length: ...

...
---8<---

This basically says: "put this in /foo/bar/boo unless there's something else already there."

From RFC2616:

[[[
The meaning of "If-None-Match: *" is that the method MUST NOT be
performed if the representation selected by the origin server (or by
a cache, possibly using the Vary mechanism, see section 14.44)
exists, and SHOULD be performed if the representation does not exist.
This feature is intended to be useful in preventing races between PUT
operations.
]]]


Are these the semantics you're looking for?



On Jun 7, 2004, at 11:26 AM, Greg Stein wrote:
Subversion needs to create unique (DeltaV) activity resources on the
server. It doesn't use POST, though. Instead, it generates a UUID and
forms a URL from that. That has worked really well for SVN.

Atom doesn't get to use that option, though, as it can be desirable to
have a resource name that somewhat corresponds to the content. For
example, most blog post URLs have generated named from the first N words
of the post. That is very nice for users, and (in the future) when
somebody is browsing a WebDAV-capable store of blog posts, it will be MUCH
nicer to have somewhat-recognizable resource names instead of UUIDs.


This POST usage isn't canonicalized as part of the standard
capabilities of a standard WebDAV collection, but it's a simple
extension and one could easily imagine standardizing it.

While true, I'd prefer a new HTTP method. The problem comes up all over
the place (e.g. the activity creation mentioned above). Maybe a method
called NEWRESOURCE or somesuch. Throw it at a collection.


[ and I'll note that the Atom effort could very well be the WG to define
this new method! ]


Cheers,
-g


-- Mark Nottingham http://www.mnot.net/