protected virtual WebClient CreateWebClient() { var client = new InnerWebClient(Timeout, OnCreateWebRequestUri, OnGetWebRequest, OnGetWebResponse); if (Headers != null) { for (var i = 0; i < Headers.Count; i++) { client.Headers.Add(Headers.GetKey(i), Headers.Get(i)); } } if (Encoding != null) { client.Encoding = Encoding; } if (this.Async) { client.DownloadStringCompleted += DownloadStringCompleted; client.UploadValuesCompleted += UploadValueCompleted; client.UploadStringCompleted += UploadStringCompleted; } return(client); }
protected virtual WebClient CreateWebClient() { var client = new InnerWebClient(Timeout, OnCreateWebRequestUri, OnGetWebRequest, OnGetWebResponse); if (Headers != null) { for (var i = 0; i < Headers.Count; i++) { client.Headers.Add(Headers.GetKey(i), Headers.Get(i)); } } if (Encoding != null) { client.Encoding = Encoding; } if (this.Async) { client.DownloadStringCompleted += DownloadStringCompleted; client.UploadValuesCompleted += UploadValueCompleted; client.UploadStringCompleted += UploadStringCompleted; } return client; }