Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^7: HTTP::Request::Common output format.

by Your Mother (Archbishop)
on Apr 19, 2016 at 20:45 UTC ( [id://1160931]=note: print w/replies, xml ) Need Help??


in reply to Re^6: HTTP::Request::Common output format.
in thread HTTP::Request::Common output format.

Oh, ok! Fine!!! Your problem is more interesting than those in my bag of holding. You will really need to dig into the documentation to make this fun and easy: HTTP::Request, LWP::UserAgent, WWW::Mechanize, &c. :P

#!/usr/bin/env perl use strictures; use WWW::Mechanize; use URI; use HTTP::Request::Common; # For fun/test, see comment below. my $app_id = shift || $ENV{APPLICATION_ID} || die "Give or set APPLICA +TION_ID\n"; my $app_pass = shift || $ENV{APPLICATION_PASS} || die "Give or set APP +LICATION_PASS\n"; my $dingus = WWW::Mechanize->new( autocheck => 0, agent => "MelleMelBot/1.0" ); $dingus->default_header( ABC_APP_ID => $app_id, IABC_APP_PASSWORD => $app_pass ); my $uri = URI->new("http://<server>:<port>/cdx/abc/gsa/deliverables"); my $post = POST $uri, Content_Type => "form-data", Content => [ deliverable_file => [ "real-path-to-sample.xml" ], file_name => "RRR-xxxxxxxxxx.mmddyyyy-hhmmss.ext", agency_task_order_parameter => "12345667890", contractor_service_request_number => "123456780123456 +789", deliverable_type => "Notification", data_transaction_file_date => "2016-01-21", tags => "[tagSample1, tagSample2]" ]; # Peek if you will. Note, default headers are not there yet. # print $post->as_string; my $response = $dingus->request( $post ); # $post object is just demo intermediary. # This could also be $dingus->post( $uri, Content ... ); # Default headers are there because they went through the Mech object. print $response->request->as_string;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1160931]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (10)
As of 2024-04-18 08:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found