in reply to Re^2: WWW::Mechanize::GZip and post() Issue
in thread WWW::Mechanize::GZip and post() Issue

Let me repeat myself:

Does the site work when you use the "normal" WWW::Mechanize instead?

By this, I mean to remove the mentions of WWW::Mechanize::GZip and replace them by WWW::Mechanize.

WWW::Mechanize (and likely, WWW::Mechanize::GZip) are derived from LWP::UserAgent and thus the approach outlined in LWP::Debug will work for them to dump the outgoing HTTP requests and the responses you get.

This is one side of the comparison. The other side, you can get for example by using the Mozilla HTTP Live Headers extension.

Compare the output of your program (resp. the dumped headers) with the headers you capture when manually navigating the site. Change your script until there are no more differences.

Replies are listed 'Best First'.
Re^4: WWW::Mechanize::GZip and post() Issue
by rotneyjacob (Initiate) on Aug 07, 2016 at 21:00 UTC
    #!/usr/bin/perl use WWW::Mechanize::GZip; `cat /dev/null > /var/www/html/r.out`; $m=`date --date="0 days ago" +'%-m'`; $m=~ s/\n//g; $d=`date --date="0 days ago" +'%-d'`; $d=~ s/\n//g; $y=`date --date="0 days ago" +'%-Y'`; $y=~ s/\n//g; $start=$m."/".$d."/".$y; #$start=trim($start); my $mech = WWW::Mechanize::GZip->new(); $response = $mech->post("http://domain.com/affiliates/login.ashx?tp=1" +,[u=>'xxxxxx',p=>'yyyyyyy']); $response = $mech->post("http://domain.com/affiliates/Extjs.ashx?s=sub +affsummary",[start_date=>'8/7/2016',end_date=>'8/7/2016',csv=>'1']); $mech->save_content("/var/www/html/uv__$y$m$d.csv"); print $response->content();
    //this my script. Kindly guide me