Debug
While using the System.Net.WebClient you might get an HTTP-Error 400 - Bad Request, unfortunately no further information is provided by the Exception-object, what particularly went wrong.
First check, that you send the correct URL (test with your webbrowser - it should work), assure, that you send the Accept-GZIP-Encoding and recheck your firewall settings, if that all failes, try the following:
Enable .NET logging
Create or open the App.config of your (executable) application and add the following code. On building your solution it will be renamed to {applicationname}.config and placed in the output directory automatically.
<configuration> |
Now start your application and have a look into the written logfile, I mostly got "Client does not support gzip encoding" caused either by firewall or by proxy.