in reply to Re: http get with perl, help needed
in thread http get with perl, help needed

Thank you!. What would I use for the request though? Assuming I do this:
use strict; use warnings; use LWP::UserAgent qw( ); use URI::Escape qw( uri_escape ); my $ua = LWP::UserAgent->new(); my $response = $ua->request(sprintf( 'http://test.test.com/ws/ws.asmx/DecryptText?text=%s&key=%s', uri_escape('SomeText'), uri_escape('SomeDecryptionKey'), )); if (!$response->is_success()) { die($response->status_line(), "\n"); } binmode STDOUT; print $response->content();
I get an error back:
You need a request object, not 'http://test.test.com/ws/ws.asmx/Decryp +tText?text=SomeText&key=SomeDecryptionKey' at test.pl line 10

Replies are listed 'Best First'.
Re^3: http get with perl, help needed
by ikegami (Patriarch) on Oct 16, 2008 at 21:06 UTC
    Oops, that should be $ua->get(...) rather $ua->request(...)
      THANKS!!!! Now Im getting a 401 Unauthorized. I shouldnt have to pass a uid/password to this site, but if I need to how would I pass the creds in this script?
        I guess I would use: $ua->credentials, but not sure how to format it to my url.