I am using this code to download file from server and parse data from JSON notation:
WebClient wcl = new WebClient();
Uri url = new Uri(tickurl);
string srlz = wcl.DownloadString(url);
var dict = (new JavaScriptSerializer()).Deserialize<Dictionary<string, dynamic>>(srlz);
When I use it with http://deepbit.net/api/ + my token (URI returns JSON data) it works well.
But with https://mtgox.com/code/data/ticker.php it stucks on 3rd line of the function(data downloading).
What am i doing wrong? Both URLs return same JSON formatted data.
[add] it’s not issue with https, this code works well enough with other https services. i am wondering if this could be a problem with SSL cert.
SOLVED: turned off SSL certificate validation. thanks
I suspect it’s failing due to a security problem. When I fetch with
wget, I get:It’s fine when I fetch with
wgetusing the--no-check-certificateflag.I don’t know whether you can persuade
WebClientnot to check certificates… but a better option would obviously be to get the certificate fixed.Alternatively, try this URL instead:
https://www.mtgox.com/code/data/ticker.php– note thewwwat the front. That fetches inwgetwithout any issues.