diff --git a/SpotifyAPI/Web/SpotifyWebClient.cs b/SpotifyAPI/Web/SpotifyWebClient.cs index 40533088..8ad55203 100644 --- a/SpotifyAPI/Web/SpotifyWebClient.cs +++ b/SpotifyAPI/Web/SpotifyWebClient.cs @@ -71,7 +71,13 @@ namespace SpotifyAPI.Web public async Task DownloadRawAsync(string url) { - return await _webClient.DownloadDataTaskAsync(url); + using (WebClient webClient = new WebClient()) + { + webClient.Proxy = null; + webClient.Encoding = _encoding; + webClient.Headers = _webClient.Headers; + return await _webClient.DownloadDataTaskAsync(url); + } } public T DownloadJson(string url) @@ -129,7 +135,13 @@ namespace SpotifyAPI.Web public async Task UploadRawAsync(string url, string body, string method) { - return await _webClient.UploadDataTaskAsync(url, method, _encoding.GetBytes(body)); + using (WebClient webClient = new WebClient()) + { + webClient.Proxy = null; + webClient.Encoding = _encoding; + webClient.Headers = _webClient.Headers; + return await _webClient.UploadDataTaskAsync(url, method, _encoding.GetBytes(body)); + } } public T UploadJson(string url, string body, string method)