Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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 having an uproarious good time at the Monastery: (6)
As of 2014-09-21 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (176 votes), past polls