Created
July 7, 2012 22:11
-
-
Save earino/3068269 to your computer and use it in GitHub Desktop.
Using LWP to mess the content type
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use warnings; | |
use strict; | |
use LWP::UserAgent; | |
use HTTP::Request::Common; | |
my $req = POST 'http://localhost:3000/', | |
Content_Type => 'form-data', | |
Content => [ name => 'Eduardo Arino', | |
email => '[email protected]', | |
gender => 'M', | |
born => '1978', | |
filename => [ | |
undef, | |
'file.jpeg', | |
'Content-Type' => 'image/jpeg', | |
'Content' => '<?php phpinfo(); ?>', | |
], | |
]; | |
my $ua = LWP::UserAgent->new(); | |
my $response = $ua->request($req); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment