I receive the following as a response from an API string
:
string responseFromServer = reader.ReadToEnd();
This string
contains:
{"success":{"username":"62b7562c90c7f7543b0eabea00359f3"}}
I want to get the user inside a variable to be able to log in with the API.
My problem is to access that data, I have tried this:
dynamic o = JsonConvert.DeserializeObject(responseFromServer);
Debug.Log(o[0]["success"][0].username);
Everything is written in a Unity script, C#. Thank you very much in advance.
I don't recommend you use dynamic but deserialize to a struct, you can help yourself with
then you get the classes
to deserialize
this way you make sure that the json you get respects the structure you want to get