private function call($url,
$method = self::METHOD_GET, array
$header =
[],
$data = null
) { if (!\
in_array($method,
$this->validMethods
)) { throw new ClientException('Invalid HTTP-METHOD: ' .
$method);
} if (!
filter_var($url, FILTER_VALIDATE_URL
)) { throw new ClientException('Invalid URL given'
);
} // Initializes the cURL instance
$curl =
curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER,
$header);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true
);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true
);