/**
* Sends request to the API server.
*
* @param string $method Request method.
* @param string $url URL.
* @param array $data Request data.
* @param string $endpoint Endpoint.
* @param AuthenticationInterface $credential Credential.
* @param boolean $is_file This is a file upload request.
* @param boolean $debug Debug this request.
*
* @return array|string
*/
public function sendRequest($method, $url, $data = array(), $endpoint, AuthenticationInterface $credential, $is_file = false, $debug = false)
{
if ($method == 'GET') {
$result = $this->getFromCache($url, $data, $endpoint);
if ($result) {
// $this->setCache($url, $data, $endpoint, $result);
return $result;
}
}
$result = $this->client->sendRequest($method, $url, $data, $endpoint, $credential);
if ($method == 'GET') {
$this->setCache($url, $data, $endpoint, $result);
}
return $result;
}