C
C#7mo ago
Kingdawanage

✅ Trying to extract nested JSON data

Asthe title says, I've been trying to find a way to get weather data from the api. The JSON file has multiple nests that i am tryign to get to. I used Json.ReadFromJsonAsync to decentralize it but it keeps failing. I am out of options
6 Replies
Sticky
Sticky7mo ago
did you try using Newtonsoft.Json?
Kingdawanage
Kingdawanage7mo ago
no. I used System.Net.Http.Json
Sticky
Sticky7mo ago
WebClient client = new WebClient();
string strPageCode = client.DownloadString(url);

var parsed = JsonConvert.DeserializeObject(strPageCode);
WebClient client = new WebClient();
string strPageCode = client.DownloadString(url);

var parsed = JsonConvert.DeserializeObject(strPageCode);
i did it like this
Kingdawanage
Kingdawanage7mo ago
I was actually able to do it a few minutes ago. But i'm trying to access other nests !solved
SinFluxx
SinFluxx7mo ago
$close
MODiX
MODiX7mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server