skip to Main Content

Json – Trying to iterate through a list of dictionaries

I have json list. I would like to iterate "PrivateIP" through a list of dirctories and append to the empty list: here's the code: InstanceId = [] message = [{"SNowTicket":"RITM00001","ServerIPList":[{"PrivateIP":"182.0.0.0", "HostName":"ip-182-0-0-0.ec2.internal", "Region":"us-east-1", "AccountID":"12345678"}, {"PrivateIP": "182.1.1.1", "HostName": "ip-182-1-1-1.ec2.internal", "Region": "us-east-1", "AccountID":…

VIEW QUESTION

JSON.NET – Deserialize not working correctly

I want to deserialize a response from RestResponse in C# (MAUI). request.AddBody(body); RestResponse response = await client.PostAsync(request); if (response.IsSuccessful) { var list1 = Newtonsoft.Json.JsonConvert.DeserializeObject<List<object>>(response.Content); } Here, inside the if block the response I want in a list of objects but…

VIEW QUESTION
Back To Top
Search