Commit 6b7f09eb authored by Evan Prodromou's avatar Evan Prodromou

add get to curl client

parent 9a9a0ae5
......@@ -60,8 +60,31 @@ class CurlClient extends HTTPClient
curl_setopt_array($ch,
array(CURLOPT_NOBODY => true));
if (!is_null($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
$result = curl_exec($ch);
curl_close($ch);
return $this->parseResults($result);
}
function get($url, $headers=null)
{
$ch = curl_init($url);
$this->setup($ch);
if (!is_null($headers)) {
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
}
$result = curl_exec($ch);
curl_close($ch);
return $this->parseResults($result);
}
......@@ -70,8 +93,7 @@ class CurlClient extends HTTPClient
curl_setopt_array($ch,
array(CURLOPT_USERAGENT, $this->userAgent(),
CURLOPT_HEADER => true,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => $headers));
CURLOPT_RETURNTRANSFER => true));
}
function userAgent()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment