[dev] Implementing HTTP PUT

Håvard Wigtil havardw at pvv.org
Tue Dec 5 09:43:29 PST 2006


tir, 05.12.2006 kl. 11.42 +0100, skrev Jan Schneider:

> Zitat von Håvard Wigtil <havardw at pvv.org>:

<snip>

> 
> > 4) I've also wondered a bit on how PUT should be implemented in terms of
> > file names. From reading the HTTP 1.1 spec it seems like the server must
> > accept the given file name or issue a "301 Moved Permanently" reply. See
> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6, "If the
> > server desires that the request be applied to a different URI, it MUST
> > send a 301 (Moved Permanently) response; the user agent MAY then make
> > its own decision regarding whether or not to redirect the request."
> > But there is also the Location header, and it seems like it can be used
> > in reply to PUT:
> > http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.30.
> >
> > Any opinions on how to understand the spec? Should Horde accept the new
> > file name (and use it as a UID in the database / storage). Should the
> > request for a new item with a UID that doesn't fit the storage scheme be
> > answered with a 301 response? Or should a new entry (file name) be
> > created and the name returned in the Location header?
> 
> GroupDAV explicitely supports redirections when putting new objects to  
> a collection. I don't know off my head how CalDAV handles this, but  
> you should really look into that spec, not the general HTTP specs.

The reason I referenced the HTTP spec was that I can't find anything
more specific on this in either the WebDAV or CalDAV specifications. 
I've looked in the WebDAV spec (http://www.ietf.org/rfc/rfc2518.txt,
section 8.7), and CalDAV
(http://ietf.osafoundation.org/caldav/draft-dusseault-caldav.txt,
section 5.3.2), but I can't see anything that offers further advise.
For the moment I'll probably implement this like GroupDAV does and just
return a "Location" header, as the other alternative of returning a
preferred name will likely require more changes.

--
Håvard Wigtil || http://wigtil.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Dette er en digitalt signert meldingsdel
Url : http://lists.horde.org/archives/dev/attachments/20061205/c3098181/attachment.bin


More information about the dev mailing list