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