HTTP::DAV::Nginx - Client library for Nginx WebDAV server
use HTTP::DAV::Nginx; $dav = HTTP::DAV::Nginx -> new('http://host.org:8080/dav/'); or $dav = HTTP::DAV::Nginx -> new('http://host.org:8080/dav/', die_on_errors => 1); unless ($dav -> mkcol('/test')) { print "ERROR:" . $dav -> err; } $dav -> put('/test/123', data => 'Hello'); $dav -> copy('/test/123', '/test2/12345'); $dav -> move('/test/123', '/test3/123456'); $dav -> delete('/test2/12345'); $ua = $dav -> useragent;
NGINX "supports" WebDAV by means of a module, but this support is incomplete: it only handles the WebDAV methods PUT, DELETE, MKCOL, COPY, and MOVE, and leaves the necessary OPTIONS and PROPFIND (and the optional LOCK, UNLOCK, and PROPPATCH) methods unimplemented.
This module doesn't uses PROPFIND and OPTIONS commands for work.
Create a new HTTP::DAV::Nginx object;
my $dav = HTTP::DAV::Nginx -> new('http://host.org:8080/dav/'); or HTTP::DAV::Nginx -> new('http://host.org:8080/dav/', die_on_errors => 1);
PARAMS:
die_on_errors - die if error
die_on_errors
warn_on_errors - warn if error
warn_on_errors
creates a new dir at the location specified by the URI
creates a duplicate of the source resource identified by URI
$dav -> copy('/uri', '/uri2');
SRC_URI - source URI
SRC_URI
DEST_URI - destination URI
DEST_URI
depth - copy depth (0, infinity)
depth
owerwrite - overwrite existing files (1 - overwrite, 0 - don't)
owerwrite
used to move a resource to the location specified by a URI
$dav -> move('/uri', '/uri2'); $dav -> move('/uri', '/uri2', overwrite => 1);
depth - move depth (0, infinity)
overwrite - overwrite existing files (1 - overwrite, 0 - don't)
overwrite
used to put data in a new resource specified by a URI
$dav -> put('/uri', data => 'Hello'); $dav -> put('/uri', file => '/etc/passwd'); $dav -> put('/uri', fh => $fh);
DATA_TYPE - type of data:
data - scalar data
data
file - filename
file
fh - filehandle
fh
DATA - scalar data or filename or filehandle
deletes a resource at the specified
$dav -> delete('/uri'); $dav -> delete('uri', depth => 'infinity');
return LWP::UserAgent object for custom options (i.e. proxy, cookie etc)
return last error string
LWP::UserAgent
Dmitry Kosenkov, <d.kosenkov AT rambler-co.ru>, <junker AT front.ru>
<d.kosenkov AT rambler-co.ru>
<junker AT front.ru>
Copyright (C) 2011 by Dmitry Kosenkov
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.1 or, at your option, any later version of Perl 5 you may have available.
To install HTTP::DAV::Nginx, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTTP::DAV::Nginx
CPAN shell
perl -MCPAN -e shell install HTTP::DAV::Nginx
For more information on module installation, please visit the detailed CPAN module installation guide.