protected function curlExec(&$ch)
{
$res = curl_exec($ch);
$http_code = curl_getinfo($ch, CURLINFO_HTTP_CODE);
if (false === $res) {
throw new \Exception(curl_error($ch), curl_errno($ch));
}
return array("http_code" => $http_code, "response" => $res);
}