/// <summary>GET request to the api that responses in XML format</summary>
        /// <param name="url">String with url</param>
        /// <param name="requestParameters">Parameters for GET request as key-value pairs</param>
        /// <returns>Dynamic object with response data</returns>
        public static dynamic GetWithXmlResponse(string url, IEnumerable <KeyValuePair <string, string> > requestParameters)
        {
            string urlWithParams = string.Format("{0}?{1}", url, KeyValueToStringConverter.Convert(requestParameters));
            var    request       = WebRequest.Create(urlWithParams) as HttpWebRequest;

            request.Credentials = CredentialCache.DefaultNetworkCredentials;
            var xDoc = XDocument.Load(request.GetResponse().GetResponseStream());

            return(XMLToDynamicConverter.Convert(xDoc.Elements().First()));
        }
        /// <summary>GET request to the api that responses in text/html format</summary>
        /// <param name="url">String with url</param>
        /// <param name="requestParameters">Parameters for GET request as key-value pairs</param>
        /// <returns>String with response data</returns>
        public static string GetWithHtmlResponse(string url, IEnumerable <KeyValuePair <string, string> > requestParameters)
        {
            using (var client = new HttpClient())
            {
                client.DefaultRequestHeaders.Accept.Clear();
                client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("text/html"));

                string urlWithParams         = string.Format("{0}?{1}", url, KeyValueToStringConverter.Convert(requestParameters));
                HttpResponseMessage response = client.GetAsync(urlWithParams).Result;
                if (response.IsSuccessStatusCode)
                {
                    return(response.Content.ReadAsStringAsync().Result);
                }
                else
                {
                    throw new HttpRequestException(string.Format("Error in {0} with param url: {1}", url, MethodBase.GetCurrentMethod().Name));
                }
            }
        }