Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: need to post a string without user intervention

by dpetrov (Acolyte)
on Jun 03, 2009 at 07:39 UTC ( [id://767923]=note: print w/replies, xml ) Need Help??


in reply to Re^2: need to post a string without user intervention
in thread need to post a string without user intervention

Okey dude. Let's say that you have your data in $last. Try smth like that:
#!/usr/bin/perl -w use strict; use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = POST 'http://www.booksforeducation.com/testbed/fred.php', [ +XML => $last, ]; my $response = $ua->request( $req )->as_string; print $resposne; # That's the output from your php script...
If you want to print the response, as html at your web server, you should add at the top print "Content-type: text/html\n\n";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://767923]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (6)
As of 2024-04-24 11:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found