In my program I need to get the content of my site, however the return of DownloadString method of the webclient object returns null, however the most intriguing is that there is no exception. the status code is 200, the request is made perfectly, but the url returns an empty string.
WebClient wc = new WebClient();
String teste = wc.DownloadString("http://www.wiplay.com.br");
My site http://www.wiplay.com.br
Seems like your website requires the user agent header to be set in order to respond.
Add the following before your call the DownloadString method:
wc.Headers.Add(HttpRequestHeader.UserAgent, "your useragent string");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With