Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: f2f22a8733
Fetching contributors…

Cannot retrieve contributors at this time

executable file 37 lines (25 sloc) 0.683 kb
#!/usr/bin/env perl6
BEGIN { @*INC.push('lib') };
use Net::Curl;
class Net::Curl::Easy {
has $.url;
method download {
my $curl = curl_easy_init;
if $curl {
curl_easy_setopt($curl, CURLOPT_URL, $.url);
# Perform the request, res will get the return code
my $res = curl_easy_perform($curl);
# Check for errors
if $res != CURLE_OK {
say "Error: curl_easy_perform() failed: " ~
curl_easy_strerror($res);
}
# always cleanup
curl_easy_cleanup($curl);
}
return "TODO implement .download";
}
}
my $curl = Net::Curl::Easy.new(url => "http://www.google.com");
my $response = $curl.download;
say $response;
Jump to Line
Something went wrong with that request. Please try again.