HTTP APPEND [Was: Re: [ANN] bzr.webdav: a writable hhtp transport]
Goffredo Baroncelli
kreijack at alice.it
Tue Aug 29 20:53:07 BST 2006
On Tuesday 22 August 2006 17:48, Vincent LADEUIL wrote:
Hello Vincent,
[...]
> jam> Does WebDAV not have any sort of Append command?
>
> Don't hold your breath. I don't have the reference handy, but a
> draft exists (dated 07/2006), proposing APPEND and PATCH
> additions to DAV.
On the basis of my search, in order to write a part of a file we have to use
the PUT method + the "Content-Range:" header directive. A typical request
should be:
PUT /path/to/file HTTP/1.1
Host: www.somehost.net
Content-Range: bytes 5-14/15
Content-Length: 10
[...]
The example above highlight how append 10 bytes of data to a file with a
(initial) length of 5 bytes.
The enclosed patch implement an example of the append method. The patch was
tested on a apache webdav implementation. I don't know if it work with other
web servers ( IIS ?? ). If you want understand better the protocol you can
watch on what curl does ( see the -C curl option ).
Open point:
1) the append phase is performed in two steps:
a) get the length of the destination (via the HEAD method )
b) append the content at the end of the file ( via PUT + Content-Range: )
We have to prevent that another client update the file between "a" and "b"
2) test with other web server
3) it is not very clear the meaning of the third parameter of the
Contenet-Range option ( the one after the '/' ): is it the length of the old
or the new file ?
Comment are welcome
Goffredo
Reference:
http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16
http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.6 (see the part
related to "Content-Range" )
http://www.hpl.hp.com/personal/ange/archives/archives-97/http-wg-archive/0079.html
http://www.hpl.hp.com/personal/ange/archives/archives-97/http-wg-archive/2530.html
--
gpg key@ keyserver.linux.it: Goffredo Baroncelli (ghigo) <kreijack at inwind.it>
Key fingerprint = CE3C 7E01 6782 30A3 5B87 87C0 BB86 505C 6B2A CFF9
-------------- next part --------------
A non-text attachment was scrubbed...
Name: dav-append.patch
Type: text/x-diff
Size: 2783 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060829/030104b2/attachment.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060829/030104b2/attachment.pgp
More information about the bazaar
mailing list