MCPcopy Create free account
hub / github.com/PenguLoader/PenguLoader / DownloadString

Method DownloadString

loader/Main/Updater.cs:163–175  ·  view source on GitHub ↗
(string url)

Source from the content-addressed store, hash-verified

161 }
162
163 static async Task<string> DownloadString(string url)
164 {
165 HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
166 request.AutomaticDecompression = DecompressionMethods.GZip | DecompressionMethods.Deflate;
167 request.UserAgent = USER_AGENT;
168
169 using (HttpWebResponse response = (HttpWebResponse)await request.GetResponseAsync())
170 using (Stream stream = response.GetResponseStream())
171 using (StreamReader reader = new StreamReader(stream))
172 {
173 return await reader.ReadToEndAsync();
174 }
175 }
176
177 static async Task DownloadFile(string url, string path, Action<long, long, int> onProgress)
178 {

Callers

nothing calls this directly

Calls 1

CreateMethod · 0.80

Tested by

no test coverage detected