Net::DAVTalk(3)
π Net::DAVTalk π
okay bestie, gather round, because this is Net::DAVTalk β the Perl module from the User Contributed Perl Documentation corner of Net::DAVTalk(3). it's giving "I talk to DAV servers so you don't have to" and honestly? iconic. π¦
Version: 0.23 β¨
β¨ SYNOPSIS β¨
so like, Net::DAVTalk was originally designed as a service module for Net::CalDAVTalk and Net::DAVTalk, and what it does is abstract the whole process of connecting to a DAV server and parsing the XML responses. main character energy, no cap. π
Example, because we love a demo:
use Net::DAVTalk;
use XML::Spice;
my $davtalk = Net::DAVTalk->new(
url => "https://dav.example.com/",
user => "foo\@example.com",
password => "letmein",
headers => { Cookie => "123", Referer => "456" },
);
$davtalk->Request(
'MKCALENDAR',
"$calendarId/",
x('C:mkcalendar', $Self->NS(),
x('D:set',
x('D:prop', @Properties),
),
),
);
$davtalk->Request(
'DELETE',
"$calendarId/",
);
πΈ SUBROUTINES/METHODS πΈ
π
$class->new(%Options)
the constructor, the moment of creation, the vibe check itself. Options:
urlβ either a fullhttps?://url, or a relative base path on the server pointing at the DAV endpoint.host,schemeandportβ the alternative to using a full URL. If the URL doesn't start withhttps?://then these get used to construct the endpoint URI.expandurlandwellknownβ if these are set, then the wellknown name (caldavandcarddavare both defined) will be used to resolve/.well-known/$wellknownto find thecurrent-user-principalURI, and then THAT will be resovlved to find the$wellknown-home-setURI, which will be used as the URL for all further actions on this object.userandpasswordβ if these are set, perform basic authentication.userandaccess_tokenβ if these are set, perform Bearer (OAUTH2) authentication.headersβ a hashref of additional headers to add to every request.SSL_optionsβ a hashref of SSL options to pass down to the default user agent.
π $Self->ua($setua)
(the original literally writes this one as my $ua = $Self->ua(); =head2 $Self->ua($setua); β POD artifact and all, we keep it π)
Get or set the useragent (HTTP::Tiny or compatible) that will be used to make the requests:
e.g.
my $ua = $Self->ua();
$Self->ua(HTTP::Tiny->new(agent => "MyAgent/1.0", timeout => 5));
π«Ά $Self->SetURL($url)
Change the endpoint URL for an existing connection. glow up, but for URLs. β¨
π $Self->SetPrincipalURL($url)
Set the URL to the DAV Principal.
π¦ $Self->fullpath($shortpath)
Convert from a relative path to a full path:
e.g
my $path = $Dav->fullpath('Default');
## /dav/calendars/user/foo/Default
NOTE: a you can pass a non-relative full path (leading /) to this function and it will be returned unchanged.
π $Self->shortpath($fullpath)
Convert from a full path to a relative path.
e.g
my $path = $Dav->fullpath('/dav/calendars/user/foo/Default');
## Default
NOTE: if the full path is outside the basepath of the object, it will be unchanged.
my $path = $Dav->fullpath('/dav/calendars/user/bar/Default');
## /dav/calendars/user/bar/Default
π₯ $Self->Request($method, $path, $content, %headers)
The whole point of the module, bestie!! Perform a DAV request against the endpoint, returning the response as a parsed hash.
methodβ http method, i.e.GET,PROPFIND,MKCOL,DELETE, etcpathβ relative to base url. With a leading slash, relative to server root, i.e."Default/","/dav/calendars/user/foo/Default".contentβ if the method takes a body, raw bytes to sendheadersβ additional headers to add to request, i.e(Depth => 1)
β $Self->GetProps($Path, @Props)
perform a propfind on a particular path and get the properties back.
π $Self->GetPropsArray($Path, @Props)
perform a propfind on a particular path and get the properties back as an array of one or more items.
π $class->GetCurrentUserPrincipal(%Args)
(the source spells this heading out as $Self->GetCurrentUserPrincipal() =head2 $class->GetCurrentUserPrincipal(%Args) β again, POD being POD π)
Can be called with the same args as new() as a class method, or on an existing object. Either way it will use the .well-known URI to find the path to the current-user-principal.
Returns a string with the path.
π§ $class->GetHomeSet(%Args)
(source heading: $Self->GetHomeSet =head2 $class->GetHomeSet(%Args) β we see you, stray =head2 π
)
Can be called with the same args as new() as a class method, or on an existing object. Either way it assumes that the created object has a 'url' parameter pointing at the current user principal URL (see GetCurrentUserPrincipal above).
Returns a string with the path to the home set.
π $Self->genuuid()
Helper to generate a uuid string. Returns a UUID, e.g.
my $uuid = $DAVTalk->genuuid(); # 9b9d68af-ad13-46b8-b7ab-30ab70da14ac
π $Self->auth_header()
Generate the authentication header to use on requests:
e.g:
$Headers{'Authorization'} = $Self->auth_header();
π« $Self->request_url()
Generate the authentication header to use on requests:
e.g:
$Headers{'Authorization'} = $Self->auth_header();
πΈ $Self->NS()
Returns a hashref of the 'xmlns:shortname' => 'full namespace' items for use in XML::Spice body generation, e.g.
$DAVTalk->Request(
'MKCALENDAR',
"$calendarId/",
x('C:mkcalendar', $Self->NS(),
x('D:set',
x('D:prop', @Properties),
),
),
);
# { 'xmlns:C' => 'urn:ietf:params:xml:ns:caldav', 'xmlns:D' => 'DAV:' }
π $Self->ns($key, $value)
Get or set namespace aliases, e.g
$Self->ns(C => 'urn:ietf:params:xml:ns:caldav');
my $NS_C = $Self->ns('C'); # urn:ietf:params:xml:ns:caldav
function2
(no description given in the source, bestie β it just sits there being mysterious. we respect it. π)
π AUTHOR π
Bron Gondwana, "<brong at cpan.org>"
π BUGS π
Please report any bugs or feature requests to "bug-net-davtalk at rt.cpan.org", or through the web interface at <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Net-DAVTalk>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. we love a feedback loop fr fr π«Ά
π SUPPORT π
You can find documentation for this module with the perldoc command.
perldoc Net::DAVTalk
You can also look for information at:
- RT: CPAN's request tracker (report bugs here)
<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Net-DAVTalk>
- AnnoCPAN: Annotated CPAN documentation
<http://annocpan.org/dist/Net-DAVTalk>
- CPAN Ratings
<http://cpanratings.perl.org/d/Net-DAVTalk>
- Search CPAN
<http://search.cpan.org/dist/Net-DAVTalk/>
π ACKNOWLEDGEMENTS π
(this section is empty in the source, so... acknowledging the silence π«‘β¨)
π LICENSE AND COPYRIGHT π
Copyright 2015 FastMail Pty. Ltd.
This program is free software; you can redistribute it and/or modify it under the terms of the the Artistic License (2.0). You may obtain a copy of the full license at:
<http://www.perlfoundation.org/artistic_license_2_0>
Any use, modification, and distribution of the Standard or Modified Versions is governed by this Artistic License. By using, modifying or distributing the Package, you accept this license. Do not use, modify, or distribute the Package, if you do not accept this license.
If your Modified Version has been derived from a Modified Version made by someone other than you, you are nevertheless required to ensure that your Modified Version complies with the requirements of this license.
This license does not grant you the right to use any trademark, service mark, tradename, or logo of the Copyright Holder.
This license includes the non-exclusive, worldwide, free-of-charge patent license to make, have made, use, offer to sell, sell, import and otherwise transfer the Package with respect to any patent claims licensable by the Copyright Holder that are necessarily infringed by the Package. If you institute patent litigation (including a cross-claim or counterclaim) against any party alleging that the Package constitutes direct or contributory patent infringement, then this Artistic License to you shall terminate on the date that such litigation is filed.
Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES. THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
and that's the whole page, bestie π this was generated by perl v5.42.0 on 2025-07-25, so like, take a lil screenshot for the archives. slay, periodt, go forth and PROPFIND. ππ¦β¨
π¦ where this page comes from
- fedora 43: perl-Net-DAVTalk 0.23-2.fc43 Β· Artistic-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms