How do I send POST data with LWP?
use LWP::UserAgent;
$ua = LWP::UserAgent->new();
$url = "http://www.twse.com.tw/ch/trading/exchange/MI_INDEX/MI_INDEX.php";
$today7 = "1040115";
$response = $ua->post( $url, { 'download' => 'csv', 'qdate' => $today7, 'selectType' => 'ALLBUT0999'} );
$content = $response->decoded_content();
my $file = 'stocks_twse.csv';
open $FH_o, ">", $file;
print $FH_o $content;
close $FH_o;
沒有留言:
張貼留言