develooper Front page | perl.libwww | Postings from March 2001

[RESEND] type=<typecode> (RFC1738)

From:
Bill.Melvin
Date:
March 15, 2001 07:07
Subject:
[RESEND] type=<typecode> (RFC1738)
Message ID:
OF7635A6F3.0BAD33E8-ON85256A10.00531630@esc.edu
Hi all, (did anyone get this the first time?)

Some particulars ...

     perl 5.005_03 built for alpha-dec_osf
     LWP 5.50
     URI 1.11

The skinny is that I cant get the "type=<typecode>" parameter to work for
ftp:// urls. I see that the check for "type=a" is commented out
around line 120 of LWP/Protocol/ftp.pm.

I will check some more on this since I shud prb be digging around
in UserAgent or URI instead of Protocol::ftp but wanted to make sure I
dont get the pointy hat for something obvious I am missing like
an RFC :-\

Anyway, here is my test script, etc.

tia,

/b

--- test junk ---

$ cat test/ftp.pl
#!/usr/bin/perl

use LWP::UserAgent;
use HTTP::Request;
use LWP::Debug qw(+debug +trace);

my $url = shift;

print "\n------- GETting $url ---------\n";

my $ua  = LWP::UserAgent->new;
my $req = HTTP::Request->new(GET => $url);
$rsp = $ua->request($req);
print $rsp->message;

__END__

$ perl test/ftp.pl ftp://ftp.cpan.org/CPAN/README
------- GET => ftp://ftp.cpan.org/CPAN/README ------------
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::simple_request: GET ftp://ftp.cpan.org/CPAN/README
LWP::UserAgent::_need_proxy: Not proxied
LWP::MediaTypes::read_media_types: Reading media types from /usr/local/lib/perl5/site_perl/5.005/LWP/media.types
LWP::Protocol::ftp::request: ()
LWP::Protocol::ftp::request: onion.valueclick.com FTP server (Version wu-2.6.1(1) Thu Nov 23 12:15:07 PST 2000) ready.
LWP::Protocol::ftp::request: Logging in as anonymous (password user@host.tld)...
LWP::Protocol::ftp::request:
LWP::Protocol::ftp::request: CWD CPAN
LWP::Protocol::ftp::request: MDTM
LWP::Protocol::ftp::request: retrieve file?
LWP::Protocol::ftp::request: Opening BINARY mode data connection for README (1941 bytes).
LWP::Protocol::collect: read 1460 bytes
LWP::Protocol::collect: read 481 bytes
LWP::UserAgent::request: Simple response: OK
Document follows

$ perl test/ftp.pl 'ftp://ftp.cpan.org/CPAN/README;type=a'

------- GETting ftp://ftp.cpan.org/CPAN/README;type=a ---------
LWP::UserAgent::new: ()
LWP::UserAgent::request: ()
LWP::UserAgent::simple_request: GET ftp://ftp.cpan.org/CPAN/README;type=a
LWP::UserAgent::_need_proxy: Not proxied
LWP::MediaTypes::read_media_types: Reading media types from /usr/local/lib/perl5/site_perl/5.005/LWP/media.types
LWP::Protocol::ftp::request: ()
LWP::Protocol::ftp::request: onion.valueclick.com FTP server (Version wu-2.6.1(1) Thu Nov 23 12:15:07 PST 2000) ready.
LWP::Protocol::ftp::request: Logging in as anonymous (password user@host.tld)...
LWP::Protocol::ftp::request:
LWP::Protocol::ftp::request: CWD CPAN
LWP::Protocol::ftp::request: MDTM
LWP::Protocol::ftp::request: retrieve file?
LWP::UserAgent::request: Simple response: Internal Server Error
^C
10648: terminated with signal 2




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About