Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: POST request issue

by moritz (Cardinal)
on Oct 07, 2013 at 08:38 UTC ( #1057238=note: print w/replies, xml ) Need Help??


in reply to POST request issue

Most Perl user agent modules allow you to create POST request with arbitrary body content, and of course you can also set headers the way you want. So you could write, for example:

use LWP::UserAgent; use HTTP::Headers; my $headers = HTTP::Headers->new(); $headers->header('Content-Disposition', 'form-data; name="fileBody"; f +ilename="[Placeholder file name]"); $headers->header('Content-Type', 'text/plain'); my $ua = LWP::UserAgent->new( default_headers => $headers, ); my $response = $ua->post($URL, Content => $content_of_your_file);

I hope that helps. If not, please reformulate your question.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057238]
help
Chatterbox?
[1nickt]: Discipulus Sorry had no time before. ++Test::Warn, but also simply Capture::Tiny to capture everything and examine it. Or just Test::Exception:: dies_ok().

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-01-22 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    How did you see in the new year?










    Results (233 votes). Check out past polls.

    Notices?