diff options
author | nosami <jasonimison@gmail.com> | 2019-11-13 22:39:17 +0300 |
---|---|---|
committer | nosami <jasonimison@gmail.com> | 2019-11-14 01:26:14 +0300 |
commit | 8e155eb572abae3db3e5f0b7e5b29de08d7bbd4f (patch) | |
tree | 023683f74d7c7bd15fe4f3ca49c4a2678e5fd3bb /main/src | |
parent | 6673afa90e9cf94b86a6b9323abf773af10504c8 (diff) |
Use HttpClientProvider class
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs index a7a00f9a36..187f88904c 100644 --- a/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs +++ b/main/src/addins/MonoDevelop.AspNetCore/MonoDevelop.AspNetCore.Scaffolding/Configuration/ScaffoldingConfig.cs @@ -1,12 +1,11 @@ using System; using System.Collections.Generic; using System.IO; -using System.Net; -using System.Net.Http; using System.Threading.Tasks; using Newtonsoft.Json; - -namespace Microsoft.WebTools.Scaffolding.Core.Config +using MonoDevelop.Core.Web; +
+namespace Microsoft.WebTools.Scaffolding.Core.Config
{ class ScaffoldingConfig { @@ -75,9 +74,8 @@ namespace Microsoft.WebTools.Scaffolding.Core.Config { if(fetchedConfig == null) { Stream stream; - using var httpClient = new HttpClient { - Timeout = TimeSpan.FromSeconds (2) - }; + using var httpClient = HttpClientProvider.CreateHttpClient (packageVersionsUrl); + httpClient.Timeout = TimeSpan.FromSeconds (2); try { stream = await httpClient.GetStreamAsync (packageVersionsUrl); |