private function urlEncoder($val)
{
return str_replace('%7E', '~', rawurlencode($val));
}
private function getParametersAsString(array $data)
{
$params = [];
foreach ($data as $key => $val)
$params[] = $key .'='. $this->urlEncoder($val);
return implode('&', $params);
}