use strict; use LWP::UserAgent; use HTTP::Request; use CGI; use CGI::Carp qw(fatalsToBrowser); my $cgi = new CGI; my $aktion = CGI::param('?name'); my $var = CGI::param('referenz'); #my $url1 = 'https://server.de/topic/?name=stefan&id=r_ft=anything'; my $url1 = 'https://server.de/topic/'; my $ua = LWP::UserAgent->new; $ua->add_handler("request_send", sub { shift->dump; return }); $ua->add_handler("response_done", sub { shift->dump; return }); my $h = HTTP::Headers->new(Content_Type => 'text/html; version=3.2', 'X-Requested-With' => 'XMLHttpRequest'); $h->user_agent('Mozilla/5.0 (compatible; MSIE 7.0; Windows NT 6.0)'); my $req = HTTP::Request->new( 'POST', $url1,['referenz => $var','r_format =>$res_format'],$h); my $response = $ua->request($req); if ($response->is_success){ #print $response->decoded_content; } else { print "Failed: \n"; print $response->status_line, "\n"; }