JSON deserializer

This is not fez related but I have a question with json. I am using a service called Cloudflare and I use their api to check to the threat score of ip addresses. The api returns JSON, I don’t have much experience with json so I tired using json2csharp but this is what I get:

public class Response
    public string __invalid_name__219.234.82.61 { get; set; }

public class RootObject
    public Response response { get; set; }
    public string result { get; set; }
    public object msg { get; set; }

The responses that I can get from the api request are:


These are things that go in the msg area.

"E_UNAUTH" -- Authentication could not be completed
"E_INVLDINPUT" -- Some other input was not valid
"E_MAXAPI" -- You have exceeded your allowed number of API calls.

Can anyone guide me towards something to deserialize the JSON.

This property name looks weird to me:


Have you seen JSON related shares on codeshare?




I will take a look at those links.

You are welcome!

If it’s not fez related, then maybe you’re using the full framework? In that case you might consider using the built-in JavaScriptSerializer class: JavaScriptSerializer Class (System.Web.Script.Serialization) | Microsoft Learn