Add GetStreamAsync method

This commit is contained in:
弘韬 张 2020-12-29 17:13:31 +08:00
parent 7dc66eaa9a
commit cfa93a2cc6

View file

@ -110,5 +110,12 @@ namespace Flow.Launcher.Infrastructure.Http
$"Error code <{response.StatusCode}> with content <{content}> returned from <{url}>");
}
}
public static async Task<Stream> GetStreamAsync([NotNull] string url)
{
Log.Debug($"|Http.Get|Url <{url}>");
var response = await client.GetAsync(url);
return await response.Content.ReadAsStreamAsync();
}
}
}