in reply to Re: HTTP::Request::Common output format.
in thread HTTP::Request::Common output format.
Thanks. Could you suggest how to achive this using REST::Client POST request as well?
use strict; use warnings; use REST::Client; use Data::Dumper; my $server = '...'; my $port = '...'; my $path = '/cdx/abc/gsa/deliverables'; my $application_id = '...'; my $application_password = '...'; my $host = 'localhost'; my %fields = ( deliverable_file => ["$ENV{PWD}/sample.xml"], data_transaction_code => "SOA", file_name => "RRR-xxxxxxxxxx.mmddyyyy-hhmmss.ext", agency_task_order_parameter => "12345667890", contractor_service_request_number => "123456780123456789" , deliverable_type => "Notification", data_transaction_file_date => "2016-01-21", tags => ["tagSample1", "tagSample2"] ); my $url = "http://$host:$port/cdx/abc/gsa/deliverables"; #print Dumper(\@INC) . "\n"; my $client = REST::Client->new(); # add the headers '-H' lines $client->addHeader('ABC_APP_ID', $application_id); $client->addHeader('IABC_APP_PASSWORD', $application_password); $client->addHeader('Content-Type', 'form-data' ); # add the fields '-F' lines print( $client->buildQuery(%fields)); $client->POST($url);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: HTTP::Request::Common output format.
by Your Mother (Archbishop) on Apr 14, 2016 at 21:50 UTC | |
|
Re^3: HTTP::Request::Common output format.
by Your Mother (Archbishop) on Apr 14, 2016 at 21:32 UTC | |
by KSHYAMKUMAR (Acolyte) on Apr 14, 2016 at 21:53 UTC | |
by Your Mother (Archbishop) on Apr 15, 2016 at 00:21 UTC | |
by KSHYAMKUMAR (Acolyte) on Apr 19, 2016 at 18:14 UTC | |
by Your Mother (Archbishop) on Apr 19, 2016 at 20:45 UTC | |
by Corion (Patriarch) on Apr 19, 2016 at 18:23 UTC | |
by Your Mother (Archbishop) on Apr 19, 2016 at 19:50 UTC |