AuntieDot.Core.Helpers.VariousFunctions.SendGetRequestAsync C# (CSharp) Метод

SendGetRequestAsync() публичный статический Метод

public static SendGetRequestAsync ( string url, string>.Dictionary headers ) : Task
url string
headers string>.Dictionary
Результат Task
		public static async Task<string> SendGetRequestAsync(string url, Dictionary<string, string> headers)
		{
			var noCache = string.Format(url.Contains("?") ? "&_={0}" : "?_={0}", Environment.TickCount);

			var request = (HttpWebRequest)WebRequest.Create(new Uri(url + noCache));

			request.Method = HttpMethod.Get;
			request.Accept = "application/json";

			foreach (var header in headers.Where(header => header.Key != "" && header.Value != ""))
                request.Headers[header.Key] = header.Value;

            var response = await request.GetResponseAsync();
            var stream = response.GetResponseStream();

		    return stream == null ? null : new StreamReader(stream).ReadToEnd();
		}
        public static string SendGetRequest(string url, Dictionary<string, string> headers)