Skip to content

Instantly share code, notes, and snippets.

@shelling
Created August 6, 2012 11:44
Show Gist options
  • Select an option

  • Save shelling/3273799 to your computer and use it in GitHub Desktop.

Select an option

Save shelling/3273799 to your computer and use it in GitHub Desktop.
$ua->request(
HTTP::Request->new(GET => $URL),
sub {
my($chunk, $res) = @_;
# do something on $chunk
}
);
$req = HTTP::Request->new(POST => $URL);
$req->header(KEY => VALUE);
$req->content($bytes);
$ua->request(
$req,
sub {
my($chunk, $socket, $res) = @_;
$socket->write($chunk);
}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment