Skip to content

Instantly share code, notes, and snippets.

@kazeburo
Created May 20, 2011 09:23
Show Gist options
  • Select an option

  • Save kazeburo/982613 to your computer and use it in GitHub Desktop.

Select an option

Save kazeburo/982613 to your computer and use it in GitHub Desktop.
#!/usr/bin/env perl
use strict;
use warnings;
use 5.10.0;
use Furl;
use Plack::TempBuffer;
my $url = "http://ftp.iij.ad.jp/pub/linux/fedora/updates/15/x86_64/exim-4.76-2.fc15.x86_64.rpm"; #1.2MB
my $furl = Furl->new(
timeout => 10,
);
my $buf = Plack::TempBuffer->new;
my $res = $furl->request(
method => 'GET',
url => $url,
write_code => sub { $buf->print($_[3]) },
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment