I'm new to json and trying to get a basic example working.
My http request returns {'username': '1'},{'username': '1'}.
I'm confused as to what valid json looks like but also how to get it into a string variable to deserialize.
Since ToJson returns {'username': '1'}, I figured the right thing to do was to put it in double quotes to convert it back.
I'm obviously missing something!
class DataItem{
public string username;
}
string json = "{'username': '1'}";
deserialized = JsonUtility.FromJson<DataItem>(json);
Error: ArgumentException: JSON parse error: Missing a name for object member.
"
, not'
– Bang