problem with Lock, Put, Unlock Scenario

82 views
Skip to first unread message

Venko Stanev

unread,
Mar 26, 2013, 12:24:37 PM3/26/13
to sardi...@googlegroups.com
Hello all, 

I would like to ask an advice on how can I implement lock, put, unlock scenario with Sardine?

With cadaver console client that does work without a problem but with sardine I still can't succeed.

The scenario in more detail is like follows:
1) User issues lock command to a resource in WebDAV that still does not exist (the WebDAV server in my case is apache and this part works with Sardine)
2) User puts the resource on the server (in other words uploads the file to WebDAV) - THIS DOES NOT WORK with Sardine but works perfectly with cadaver
3) User unlocks the resource (this works OK)

Best Regards,
Venko Stanev

Venko Stanev

unread,
Mar 26, 2013, 12:57:37 PM3/26/13
to sardi...@googlegroups.com
Dear all, 

as it usually happens - few minutes after I published my question I discovered the answer but I will publish it here in case that somebody else needs it.

It turns out that the "If" HTTP header makes the difference.
One should add header similar to this:
If: <http://192.168.21.223/webdav/venko.txt> (<opaquelocktoken:93dec4ff-f628-4e93-b954-aea44c12d61c>)
if the PUT HTTP request has that header everything works as expected.

Best Regards,
Venko
Reply all
Reply to author
Forward
0 new messages