“A connection attempt failed because the connected party did not properly respond after a period of time” using WebClient

I had a similar problem and had to convert the URL from string to Uri object using:

Uri myUri = new Uri(URLInStringFormat, UriKind.Absolute);

(URLInStringFormat is your URL)
Try to connect using the Uri instead of the string as:

WebClient client = new WebClient();

Leave a Comment