JustPaste.it

use 5.010;
use strict;
use warnings;
use Data::Dumper;
use Mojo::UserAgent;

my $ua = Mojo::UserAgent->new();

my $tx = $ua->build_tx(GET => 'http://vk.com');
my %headers = (ยท
'Connection' => 'keep-alive',
'User-Agent' => 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/29.0.1547.65 Chrome/29.0.1547.65 Safari/537.36',
'Accept-Encoding' => 'gzip,deflate,sdch',
'Accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Language' => 'en-US,en;q=0.8',
'Host' => 'localhost:3000'
);
$tx->req->headers->remove($_) for keys $tx->req->headers->to_hash;
$tx->req->headers->from_hash(\%headers);


$ua->start($tx => sub {
say Dumper \@_;
#I expect to see vk.com response here .... ((
Mojo::IOLoop->stop;
});
Mojo::IOLoop->start;