Lines Matching refs:curl

44     my $curl = WWW::Curl::Easy::new();
47 $curl->setopt(CURLOPT_VERBOSE, 1) if $options{d};
48 $curl->setopt(CURLOPT_FAILONERROR, 1);
49 $curl->setopt(CURLOPT_USERAGENT,
53 $curl->setopt(CURLOPT_UPLOAD, 1);
54 $curl->setopt(CURLOPT_CUSTOMREQUEST, "POST");
55 $curl->setopt(CURLOPT_HTTPHEADER,
58 $curl->setopt(CURLOPT_READFUNCTION, \&read_body);
59 $curl->setopt(CURLOPT_HEADERFUNCTION, sub { return length($_[0]); });
62 $curl->setopt(CURLOPT_WRITEFUNCTION, \&write_body);
65 $curl->setopt(CURLOPT_SSLKEYTYPE, "PEM");
66 $curl->setopt(CURLOPT_SSL_VERIFYPEER, 1); # Verify server's certificate.
67 $curl->setopt(CURLOPT_SSL_VERIFYHOST, 2); # Check server's CN.
68 $curl->setopt(CURLOPT_SSLKEY, $options{k}) if defined($options{k});
69 $curl->setopt(CURLOPT_SSLKEYPASSWD, $options{p}) if defined($options{p});
70 $curl->setopt(CURLOPT_SSLCERT, $options{c}) if defined($options{c});
71 $curl->setopt(CURLOPT_CAINFO, $options{C}) if defined($options{C});
72 $curl->setopt(CURLOPT_CAPATH, $options{P}) if defined($options{P});
73 $curl->setopt(CURLOPT_RANDOM_FILE, $options{r}) if defined($options{r});
74 $curl->setopt(CURLOPT_EGDSOCKET, $options{g}) if defined($options{g});
77 $curl->setopt(CURLOPT_URL, $url);
79 return $curl;
84 my $curl = shift;
90 $curl->setopt(CURLOPT_ERRORBUFFER, "::error_buf");
93 $curl->setopt(CURLOPT_INFILE, {data => $body, bytes => 0});
94 $curl->setopt(CURLOPT_INFILESIZE, length(${$body}));
97 $curl->setopt(CURLOPT_FILE, \$ts_body);
100 my $error_code = $curl->perform();
103 my $http_code = $curl->getinfo(CURLINFO_HTTP_CODE);
106 $error_string .= ", curl code: $error_code";
109 my $ct = $curl->getinfo(CURLINFO_CONTENT_TYPE);
154 my $curl = create_curl $options{h};
180 my ($ts_body, $error) = get_timestamp $curl, \$body;
200 $curl->cleanup();