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

Re: Setting Content-Type when POSTing with LWP

by larryk (Friar)
on Aug 29, 2002 at 21:59 UTC ( #193932=note: print w/ replies, xml ) Need Help??


in reply to Setting Content-Type when POSTing with LWP

This is untested and I have to rush off but I hope it works

#!perl use strict; use warnings; use LWP::UserAgent; use HTTP::Headers; use HTTP::Request; my $content = join '', <DATA>; my $ua = LWP::UserAgent->new(); my $h = HTTP::Headers->new( Content_Disposition => 'form-data; name="fname"; filename="deposit +1.xml"', Content_Length => length($content), Content_Type => 'text/xml' ); my $r = HTTP::Request->new('POST', 'http://search.cpan.org/', $h, $con +tent); my $response = $ua->request($r); __DATA__ <?xml version="1.0"?> ...
   larryk                                          
perl -le "s,,reverse killer,e,y,rifle,lycra,,print"


Comment on Re: Setting Content-Type when POSTing with LWP
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (5)
As of 2015-07-02 23:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (47 votes), past polls