JSON and VB.net
I've got a small utility I use to communicate with Yahoo's APIs. Their servers return all the re开发者_开发百科sponses in JSON.
Is there an easy way to parse this into its base form when you don't necessarily know what will be in the response?
{
"sessionId": "A.bpAsPs3RPYF0nUuAnCtuEUJMOmDDHbjZG5",
"primaryLoginId": "prometheussoft",
"displayInfo": {
"avatarPreference": "2",
"checksum": "-1484747745"
},
"server": "rcore1.messenger.yahooapis.com",
"notifyServer": "rproxy1.messenger.yahooapis.com",
"constants": {
"presenceSubscriptionsMaxPerRequest": 60
}
}
you can deserialize it to a dictionary with string parsing, any values that are objects can be done the same way with a nested dictionary.
However to get typing on the values you will need to at least know what is expected for each property
精彩评论