Problems with Perl and LWP
Posted: 24 Jul 2006, 18:19
I am writing little web program with Perl and LWP(this is my first program with LWP (not LWP::Simple and not Socket). It works now, but there is still a lot of work to do.
My biggest problem by now is that I want to make HTTP reqest:
For this task I wrote this:
I do not paste other code here because post will be wry big then.
And everything looks god just not woks.
So I turned on netwoks snifer, and done this request to server with Opera and later with my program.
Snifer from Opera captures:
Any ideas or sugestions?
My biggest problem by now is that I want to make HTTP reqest:
Code: Select all
POST .....
....
...
action=go+to+minurl
Code: Select all
#!c:\perl\bin
use LWP;
use HTTP::Cookies;
#lots of other tasks
my ($tur, $msg, $is) = do_POST(
'http://site.is/here',
[ 'action'=> "go+to+minurl" ],
);
print "$msg\n$is";
#lots of other tasks
sub do_POST {
$browser = LWP::UserAgent->new( ) unless $browser;
$browser ->default_header(Cookie=>$sausainis);
my $resp = $browser->post(@_);
return ($resp->content, $resp->status_line, $resp->is_success, $resp)
if wantarray;
return unless $resp->is_success;
return $resp->content;
}
#other sub's
And everything looks god just not woks.
So I turned on netwoks snifer, and done this request to server with Opera and later with my program.
Snifer from Opera captures:
And form my program:go+to+minurl
I know that %2B is just encoded +, but if it makes difference to snifer maybe webserver can not understand this too?go%2Bto%2Bminurl
Any ideas or sugestions?