#!/usr/bin/perl use strict; use warnings; use Data::Dumper; my $command = <<'END'; curl 'https://tax-calculator-api.taxfoundation.org/taxcalc/tcja_submit' -H 'Origin: https://taxfoundation.org' -H 'Accept-Encoding: gzip, deflate, br' -H 'Accept-Language: en-US,en;q=0.9' -H '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' -H 'content-type: application/json' -H 'Accept: */*' -H 'Referer: https://taxfoundation.org/2018-tax-reform-calculator/' -H 'Connection: keep-alive' --data-binary $'{"filing_status": 1, "child_dep": 2, "nonchild_dep": 0, "ordinary_income1": 150000, "ordinary_income2": 0, "business_income": 0, "ss_income": 0, "qualified_income": 0, "401k_contributions": 0, "medical_expenses": 0, "sl_income_tax": 0, "sl_property_tax": 0, "interest_paid": 0, "charity_contributions": 0, "other_itemized": 0}' --compressed END print $command; my $data = `$command` or die "$!\n"; print Dumper $data;