- my $uri = URI->new($api_uri);
- $uri->query_form(\%opt);
- warn "$class->query\n$uri\n\n" if $DEBUG;
- my $http_req = HTTP::Request->new(GET => $uri->as_string);
- my $resp = $ua->request($http_req);
- my $self = { addr_response => $resp };
- bless $self, $class;
+ $csv->combine(@row);
+ warn "Sending:\n".$csv->string."\n" if $DEBUG;
+
+ # they are not picky about content types, Accept headers, etc., but
+ # the uploaded file must have a _name_.
+ my $resp = $ua->request(POST $url,
+ 'Content_Type' => 'form-data',
+ 'Content' => [ benchmark => $opt{benchmark},
+ vintage => $opt{vintage},
+ returntype => $opt{returntype},
+ addressFile => [ undef, 'upload.csv',
+ Content => $csv->string
+ ],
+ ],
+ );