c# - How can I use WebClient.DownloadString from a secure URL (https)? -
the code i'm using
webclient webclient = new webclient(); string xmlresult = webclient.downloadstring("https://kat.cr/usearch/ubuntu/?rss=1");
i'm bit confused url seems tunnel through secondary page kastatic.com:443 , kat.cr:443 (if i'm understanding fiddler correctly).
the server certificate seems fine adding following code nothing helpful
servicepointmanager.servercertificatevalidationcallback = (sender, certificate, chain, sslpolicyerrors) => { return true; };
i've tried setting useragent headers on webclient object in case need identify browser or don't think i'm on right track.
edit: response "12a9" 2 odd ascii characters trailing (a question mark symbol , white circle black border.
if @ headers in fiddler, response gzip-encoded (compressed). see this answer how deal this, since there's no "quick , easy" way webclient
class.
Comments
Post a Comment