Hi,
I am trying to do a simple post request which is just not working. I just need a working example of something simple and then I will be able to hopefully imitate it for other forms I'm using. For example, does anyone know why the following is not working for me? I'm just getting the page with the form, not the result page. I tried both the URL that is enabled below as well as the commented out one. Thanks a lot for any help!
I am trying to do a simple post request which is just not working. I just need a working example of something simple and then I will be able to hopefully imitate it for other forms I'm using. For example, does anyone know why the following is not working for me? I'm just getting the page with the form, not the result page. I tried both the URL that is enabled below as well as the commented out one. Thanks a lot for any help!
Code:
use LWP;
my $browser = LWP::UserAgent->new;
$browser->cookie_jar({});
my $url = '[URL unfurl="true"]http://www.fjc.gov/public/home.nsf/hisj';[/URL]
#my $url = '[URL unfurl="true"]http://www.fjc.gov/history/home.nsf/search_db_sybase!OpenForm&Seq=1&BaseTarget=right';[/URL]
my $response = $browser->post
(
$url,
[
'_Click' => '0',
'name' => 'posner'
]
);
die "$url error: ", $response->status_line unless $response->is_success;
print $response->content;