C
cerr
Hi There,
I'm using libwww to post data to a form. Once data is posted, the
server would send me back a file. How can i retrieve and safe this
file?
I'm posting the data with below code:
$response = $browser->get($url);
print $response->header('WWW-Authenticate'),"\n";
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
#print "Authentication successful! Got ",$response->content_type, "
document!\n";
# Create a post request
my $post = HTTP::Request->new(POST => $PostPage);
#print "Posting data to \"$PostPage\"\n";
$post->content_type('application/x-www-form-urlencoded');
$post->content('export_profile=Current%20Profile');
# Pass request to the user agent and get a response back
my $res = $browser->request($post);
# Check the outcome of the response
if ($res->is_success) {
print $res->content , "\n";
}
else {
print $res->status_line, "\n";
}
How can I wait here until i get a file?
Thanks for hints and suggestions!
I'm using libwww to post data to a form. Once data is posted, the
server would send me back a file. How can i retrieve and safe this
file?
I'm posting the data with below code:
$response = $browser->get($url);
print $response->header('WWW-Authenticate'),"\n";
die "Error at $url\n ", $response->status_line, "\n Aborting"
unless $response->is_success;
#print "Authentication successful! Got ",$response->content_type, "
document!\n";
# Create a post request
my $post = HTTP::Request->new(POST => $PostPage);
#print "Posting data to \"$PostPage\"\n";
$post->content_type('application/x-www-form-urlencoded');
$post->content('export_profile=Current%20Profile');
# Pass request to the user agent and get a response back
my $res = $browser->request($post);
# Check the outcome of the response
if ($res->is_success) {
print $res->content , "\n";
}
else {
print $res->status_line, "\n";
}
How can I wait here until i get a file?
Thanks for hints and suggestions!