public function downloadFile(string $url, string $filename, array $params = []) : ResponseInterface
{
$fp = \fopen($filename, 'wb');
$opts = $this->params($params, $url);
$opts[\CURLOPT_FOLLOWLOCATION] = true;
$opts[\CURLOPT_FILE] = $fp;
$result = $this->client->post($url, $opts);
\fclose($fp);
return $result;
}