A lot of modern programming languages have JSON libraries that support encoding and decoding json to/from "plain old objects" - i.e. instances of classes that p
I am using the following code. It only works if the JSON data does not start with a '[' character. It works fine for JSON data starting with a '{' character.