When I calling site www.livescore.com by HttpClient class I always getting error "500".
Probably server blocked request from HttpClients.
1)There is any other method to get html from webpage?
2)How I can set the headers to get html content?
When I set headers like in browser I always get stange encoded content.
http_client.DefaultRequestHeaders.TryAddWithoutValidation("Accept", "text/html,application/xhtml+xml,application/xml");
http_client.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Encoding", "gzip, deflate");
http_client.DefaultRequestHeaders.TryAddWithoutValidation("User-Agent", "Mozilla/5.0 (Windows NT 6.2; WOW64; rv:19.0) Gecko/20100101 Firefox/19.0");
http_client.DefaultRequestHeaders.TryAddWithoutValidation("Accept-Charset", "ISO-8859-1");
3) How I can slove this problem? Any suggestions?
I using Windows 8 Metro Style App in C# and HttpClientClass
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…