3
I need to get data via JSON, through a URL, this link: https://cryptohub.online/api/market/ticker/egx/
I’m trying with the code below, but I already get error as soon as it downloads the string.
The error received is:
The character chair is not in JSON format.
However, by the (little) I understand, it seems to me that the return is OK in format.
Any idea what might be going on?
This is my code:
using (var webClient = new System.Net.WebClient())
{
var json = webClient.DownloadString("https://cryptohub.online/api/market/ticker/EGX/");
dynamic obj = JsonConvert.DeserializeObject(json);
var btc = 0.0;
foreach (var result in obj.BTC_EGX)
btc = result.last;
Hi Paulrocost, gave error when compiling: Error The name 'Servicepointmanager' does not exist in the current context
– Odacir Cristofolini
tomorrow we’ll come back to try to settle this here, anyway, thanks for the force!
– Odacir Cristofolini
you just need to add the reference, the
using
, to theServicePoint Manager
. If I’m not mistaken, it’s:using System.Net;
.– vhoyer
That’s right; you need to add the reference "using System.Net" because the object you will set tls is inside it.
– paulrocost
Perfect Solved the problem! Thank you @paulocost and vhoyer
– Odacir Cristofolini