1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
OPTIONS http://testserver/dav/
User-Agent: lwp-request/6.03 libwww-perl/6.07
200 OK
Cache-Control: max-age=604800
Connection: close
Date: Mon, 22 Sep 2014 14:33:11 GMT
Server: Apache/2.2.25 (Win32) DAV/2 mod_ssl/2.2.25 OpenSSL/0.9.8y PHP/5.4.32 mod_apreq2-20090110/2.8.0 mod_perl/2.0.8 Perl/v5.14.4
Allow: OPTIONS,GET,HEAD,POST,DELETE,TRACE,PROPFIND,PROPPATCH,COPY,MOVE,LOCK,UNLOCK
Content-Length: 0
Content-Type: httpd/unix-directory
Expires: Mon, 29 Sep 2014 14:33:11 GMT
Client-Date: Mon, 22 Sep 2014 14:33:11 GMT
Client-Peer: 192.168.138.76:80
Client-Response-Num: 1
DAV: 1,2
MS-Author-Via: DAV
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
#!/usr/bin/perl use strict; use warnings; use 5.010; use LWP::UserAgent; use HTTP::Request; sub has_dav { my $uri = shift; my %options = @_; my $ua = LWP::UserAgent->new; my $request = HTTP::Request->new( OPTIONS => $uri ); my $response = $ua->request($request); say STDERR $request->as_string if $options{DEBUG}; say STDERR $response->as_string if $options{DEBUG}; return $response->as_string =~ /DAV/i; } $| = 1; say q(Hat DAV! ) if has_dav('http://testserver/dav/'); # und mit DEBUG say q(--------------------------------- DEBUGMODE Hat DAV! --------------------------------- ) if has_dav( 'http://testserver/dav/', DEBUG => 1 );
2014-09-22T15:46:46 biancaDas sin aber auch die normalen Methoden bei HTTP, mit WebDAV haben die vier nichts zu tun.Zwar nur Allow: GET,HEAD,POST,OPTIONS aber immerhin.
2014-09-22T15:46:46 bianca(...) wo kann ich mich einlesen (wenn es geht in Deutsch), wie ich mit einem serverseitigen Perlscript solche Request beantworte? Geht das wie bei CGI? Alles einlesen und dann Header+Content auf STDOUT printen?
2014-09-23T06:29:34 GwenDragonWozu musst du solche Request beantworten?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
use strict; use warnings; use LWP::UserAgent; ### hole Daten binär my $filename = 'test.txt'; my $content; { #slurp mode $/ = undef; open (my $fh, '<', $filename) or die $!; binmode $fh; $content = <$fh>; close $fh; } ### Erzeuge Client my $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); my $url = 'https://webdav.mediencenter.t-online.de/' . "$filename"; # Authentifizierung, https://metacpan.org/pod/distribution/libwww-perl/lwptut.pod#HTTP-Authentication $ua->credentials( 'webdav.mediencenter.t-online.de:443', # Domain:Port 'webdav-ng', # Authentication realm 'xxx-yyyyyyyyyyyy@t-online.de' => 'test123' # Loginname, Passwort ); # PUT-Request absenden my $res = $ua->put($url, content => $content ); if ( $res->is_success ) { #print $res->content; } else { print $res->status_line, "\n"; }
QuoteCPAN.pm: Building C/CO/COSIMO/HTTP-DAV-0.47.tar.gz
Checking if your kit is complete...
Looks good
Writing Makefile for HTTP::DAV
Writing MYMETA.yml and MYMETA.json
cp lib/HTTP/DAV/Response.pm blib\lib\HTTP\DAV\Response.pm
cp lib/HTTP/DAV/ResourceList.pm blib\lib\HTTP\DAV\ResourceList.pm
cp lib/HTTP/DAV.pm blib\lib\HTTP\DAV.pm
cp lib/HTTP/DAV/Comms.pm blib\lib\HTTP\DAV\Comms.pm
cp lib/HTTP/DAV/Resource.pm blib\lib\HTTP\DAV\Resource.pm
cp lib/HTTP/DAV/Utils.pm blib\lib\HTTP\DAV\Utils.pm
cp lib/HTTP/DAV/Changes.pod blib\lib\HTTP\DAV\Changes.pod
cp lib/HTTP/DAV/Lock.pm blib\lib\HTTP\DAV\Lock.pm
C:\strawberry\perl\bin\perl.exe -MExtUtils::Command -e cp -- bin/dave blib\script\dave
pl2bat.bat blib\script\dave
COSIMO/HTTP-DAV-0.47.tar.gz
C:\strawberry\c\bin\dmake.exe -- OK
Running make test
C:\strawberry\perl\bin\perl.exe "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib\lib', 'blib\arch')" t/*.t
t/1_loadme.t ............ Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/1_loadme.t ............ ok
t/1_utils.t ............. ok
t/2_options.t ........... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/2_options.t ........... ok
t/3_put_get_delete.t .... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/3_put_get_delete.t .... ok
t/4_multistatus.t ....... ok
t/5_propfind.t .......... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/5_propfind.t .......... ok
t/5_proppatch.t ......... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/5_proppatch.t ......... ok
t/6_dav_copy_move.t ..... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/6_dav_copy_move.t ..... ok
t/6_dav_get_callback.t .. ok
t/6_dav_globs.t ......... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/6_dav_globs.t ......... ok
t/6_dav_lock.t .......... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/6_dav_lock.t .......... ok
t/6_dav_lock2.t ......... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/6_dav_lock2.t ......... ok
t/6_dav_open_put_get.t .. ok
t/6_dav_options.t ....... Use of uninitialized value $ENV{"PERLDAV_TEST"} in lc at t/TestDetails.pm line 42.
t/6_dav_options.t ....... ok
t/9_RT_19616.t .......... ok
t/9_RT_38677.t .......... ok
t/9_RT_42877.t .......... ok
t/9_RT_47500.t .......... ok
t/9_RT_52665.t .......... ok
t/9_RT_59674.t .......... ok
t/9_RT_60457.t .......... ok
t/9_RT_68936.t .......... ok
t/9_RT_69439.t .......... 1/11
# Failed test at t/9_RT_69439.t line 36.
# Failed test at t/9_RT_69439.t line 37.
# Failed test 'Removed temp files'
# at t/9_RT_69439.t line 39.
# got: '0'
# expected: '2'
cannot unlink file for .http-dav-test-tmpdir.2412\dave3HeCXwg2d5tp7.tmp: Permission denied at t/9_RT_69439.t line 41.
cannot unlink file for .http-dav-test-tmpdir.2412\daveSWKD7ig4XV6Iy.tmp: Permission denied at t/9_RT_69439.t line 41.
cannot remove directory for .http-dav-test-tmpdir.2412: Directory not empty at t/9_RT_69439.t line 41.
# Failed test 'Cleaned up temp dir'
# at t/9_RT_69439.t line 41.
# Looks like you failed 4 tests of 11.
t/9_RT_69439.t .......... Dubious, test returned 4 (wstat 1024, 0x400)
Failed 4/11 subtests
Test Summary Report
-------------------
t/9_RT_69439.t (Wstat: 1024 Tests: 11 Failed: 4)
Failed tests: 8-11
Non-zero exit status: 4
Files=23, Tests=228, 9 wallclock secs ( 0.12 usr + 0.03 sys = 0.16 CPU)
Result: FAIL
Failed 1/23 test programs. 4/228 subtests failed.
dmake.exe: Error code 132, while making 'test_dynamic'
COSIMO/HTTP-DAV-0.47.tar.gz
C:\strawberry\c\bin\dmake.exe test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports COSIMO/HTTP-DAV-0.47.tar.gz
Running make install
make test had returned bad status, won't install without force
Stopping: 'install' failed for 'HTTP::DAV'.
Failed during this command:
COSIMO/HTTP-DAV-0.47.tar.gz : make_test NO
1
2
3
4
cpan https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.41.tar.gz
cpan https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.42.tar.gz
cpan https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.43.tar.gz
cpan https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.44.tar.gz
2015-01-03T10:15:33 GwenDragonAnsonsten probier malNet::Async::HTTP::DAV
2015-01-03T10:15:33 GwenDragonAnsonsten probier malNet::Async::HTTP::DAV
QuoteTest Summary Report
-------------------
t\41routine.t (Wstat: 6400 Tests: 18 Failed: 0)
Non-zero exit status: 25
Parse errors: No plan found in TAP output
Files=59, Tests=1153, 125 wallclock secs ( 0.41 usr + 0.05 sys = 0.45 CPU)
Result: FAIL
Failed 1/59 test programs. 0/1153 subtests failed.
PEVANS/IO-Async-0.64.tar.gz
C:\strawberry\perl\bin\perl.exe ./Build test -- NOT OK
//hint// to see the cpan-testers results for installing this module, try:
reports PEVANS/IO-Async-0.64.tar.gz
Running Build install
make test had returned bad status, won't install without force
Stopping: 'install' failed for 'P/PE/PEVANS/IO-Async-0.64.tar.gz'.
Failed during this command:
PEVANS/IO-Async-0.64.tar.gz : make_test NO
2015-01-03T10:15:33 GwenDragonversuche bitte mal ältere Versionen (könnten laut Testermatrix installieren)
1
2
3
4
5
cpan> install https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.44.tar.gz
Database was generated on Mon, 05 Jan 2015 18:09:10 GMT
Running make for https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.44.tar.gz
Catching error: "mkdir C:\\strawberry\\cpan\\sources\\authors\\id\\https:\\: Invalid argument; Die Syntax f³r den Dateinamen, Verzeichnisnamen oder die Datentrõgerbezeichnung ist falsch at C:\\strawberry\\perl\\lib/CPAN/FTP.pm line 519.\cJ" at C:/strawberry/perl/lib/CPAN.pm line 392, <IN> line 3.
CPAN::shell() called at -e line 1
1
2
3
cpan> get https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.44.tar.gz
Catching error: "mkdir C:\\strawberry\\cpan\\sources\\authors\\id\\https:\\: Invalid argument; Die Syntax f³r den Dateinamen, Verzeichnisnamen oder die Datentrõgerbezeichnung ist falsch at C:\\strawberry\\perl\\lib/CPAN/FTP.pm line 519.\cJ" at C:/strawberry/perl/lib/CPAN.pm line 392, <IN> line 5.
CPAN::shell() called at -e line 1
2015-01-03T10:15:33 GwenDragonCode: (dl )cpan https://cpan.metacpan.org/authors/id/O/OP/OPERA/HTTP-DAV-0.44.tar.gz
2015-01-03T12:09:22 pqist auf jeder cpan-seite verlinkt und verbirgt sich hinter dem matrix-icon unter dem punkt "Testers": http://matrix.cpantesters.org/?dist=HTTP-DAV+0.47