![]() |
![]() |
I tried, but my posturl sub showed up in the logs
as posting but no data was being posted.... Any ideas?
Geoff
_________________________________________________
sub posturl {
my($url) = @_; require LWP::UserAgent; require HTTP::Request; print("posturl url $url\n") if $Global::DEBUG; my $string = ""; $url = "http://$url" unless ($url =~ /^\w+:\/\//); my $ua = new
LWP::UserAgent;
$ua->agent("Mozilla/4.0 (compatible; MSIE 4.01; Windows 98)"); my $request = new HTTP::Request 'POST', $url; my $response =
$ua->request($request);
if ($response->is_success) { $string = $response->content(); } return $string; } EndOfSub ---------------------------------------------------------------------------------------
And this calling it...
__________________________________________________
[set name=post interpolate=1]
[perl arg="sub" interpolate=1 global=1]posturl("http://shop.getasite.com.au/cgi-bin/getasite/post.html?var1=Hello") [/perl][/set]
[scratch post] |