in reply to Re: Runs from Command Line but NOT from Perl
in thread Runs from Command Line but NOT from Perl
#!/usr/bin/perl use strict; use warnings; use HTTP::Request::Common qw( POST ); use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = POST 'https://tax-calculator-api.taxfoundation.org/taxcalc/t +cja_submit', [ Host => 'tax-calculator-api.taxfoundation.org', Connection => 'keep-alive', Origin => 'https://taxfoundation.org', 'User-Agent' => 'Mozilla/5.0 (Windows NT 10.0; Win64; x64 +) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/ +537.36', 'content-type' => 'application/json', Accept => '*/*', Referer => 'https://taxfoundation.org/2018-tax-refor +m-calculator/', 'Accept-Encoding' => 'gzip, deflate, br', 'Accept-Language' => 'en-US,en;q=0.9', Content => [ '401k_contributions' => 0, business_income => 0, charity_contributions => 0, child_dep => 2, filing_status => 2, interest_paid => 0, medical_expenses => 0, nonchild_dep => 0, ordinary_income1 => 150000, ordinary_income2 => 0, other_itemized => 0, qualified_income => 0, sl_income_tax => 0, sl_property_tax => 0, ss_income => 0, ], ]; print $ua->request($req)->as_string;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Runs from Command Line but NOT from Perl
by poj (Abbot) on Oct 19, 2018 at 06:24 UTC | |
by Anonymous Monk on Oct 19, 2018 at 08:15 UTC |