public function close()
{
if (is_resource($this->curl)) {
curl_close($this->curl);
}
$this->options = null;
$this->jsonDecoder = null;
$this->xmlDecoder = null;
$this->defaultDecoder = null;
}
/** * Execute a request against the url. * * @param string $url * @param array $params * * @return mixed */ public function request($url, array $params = []) { $this->curl->get($url, $params); $this->curl->setOpt(CURLOPT_RETURNTRANSFER, true); $response = $this->curl->response; $this->curl->close(); return $response; }