Proxy Submission (perl)

I want to send a parameter (phd => text , go => submit)using an http proxy. How can i do this?

I have this Perl code:

my $ua = LWP::UserAgent->new();
my $req = POST 'http://example.com',
[ phd => 'text' , go => 'submit'];
$content = $ua->request($req)->as_string; 
print $content;
+3
source share
3 answers

Add to the instructions so that the user agent knows the location of your proxy:

$ua->proxy("http", "http://localhost:8888");

Regarding the comment that POST is a valid thing (which I probably wouldn't have noticed), there is something like this in my module:

use HTTP::Request::Common qw( POST GET );
+1
source

, , - http://blog.gnucom.cc/?p=122 - ( , ).

, , , - , POST . POST, -, example.com/target_form.php. , - , .: D

0

Source: https://habr.com/ru/post/1754333/


All Articles