🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

UnityWebRequest result can't be deserialized to JSON

Started by
11 comments, last by NDraskovic 6 years, 5 months ago

What you can do is using another deserializer than what Unity3D provides.

I hope you can get the result from the reserver as pure text, then you can feed it into a library like MiniJSON, instead of working with objects, you are given a dictionary with <string, object>. It has some advantages, like supporting more character in keys, for example:
 


{
   "this#would_not_work_in_unity_deserialiser": "But it works fine with MiniJSON"
}

However, the syntax ond access and update gets a bit uglier, also having all JSON as objects makes it more easy to see the format, just having a dictionary with anything with it is bit harder to debug. No big issue thou.

I have been using MiniJSON successfully myself. Here is a link to what I believe is its official github:

https://gist.github.com/darktable/1411710 

Advertisement

I went and made my own parser, it works fine so far, so I'll be using that, but thanks for the answers, it's going to come in handy later.

This topic is closed to new replies.

Advertisement