Capturing response body – Web Client 400 bad request

How can I capture the response body of bad request – see img attached. >Solution : If you catch this Exception as the WebClientResponseException that it obviously is, you can use a method that returns the body. } catch(WebClientResponseException e) { String responseBody = e.getResponseBodyAsString(); //log it? }

Progress in FTP file upload with WebClient in C#

I have the following code that works – uploads the file, but neither progress nor completion events are fired. Any ideas why? try { string srcFilePath = @"C:\Projects\MySetup.zip"; string url = "ftp://xxx.xxx.xxx.xxx/downloads/MySetup.zip"; Uri uri = new Uri(url); WebClient client = new WebClient(); client.Credentials = new NetworkCredential("userName", "pass"); client.DownloadFileCompleted += Client_DownloadFileCompleted; client.DownloadProgressChanged += Client_DownloadProgressChanged; ServicePointManager.SecurityProtocol =… Read More Progress in FTP file upload with WebClient in C#