AnalyticsApi.HttpWrapper.Get C# (CSharp) Method

Get() public method

public Get ( string url, string>.Dictionary headers ) : string
url string
headers string>.Dictionary
return string
        public string Get(string url, Dictionary<string, string> headers)
        {
            var req = (HttpWebRequest)WebRequest.Create(url);
            req.Headers.Add(headers.ToNameValueCollection());

            Debug.WriteLine(url);

            using(var response = (HttpWebResponse)req.GetResponse())
            using(var responseStream = response.GetResponseStream())
            using(var sr = new StreamReader(responseStream))
            {
                return sr.ReadToEnd().Trim();
            }
        }