C
C#9mo 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
Sticky9mo ago
did you try using Newtonsoft.Json?
Kingdawanage
KingdawanageOP9mo ago
no. I used System.Net.Http.Json
Sticky
Sticky9mo 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
KingdawanageOP9mo ago
I was actually able to do it a few minutes ago. But i'm trying to access other nests !solved
SinFluxx
SinFluxx9mo ago
$close
MODiX
MODiX9mo ago
Use the /close command to mark a forum thread as answered
Want results from more Discord servers?
Add your server