This my code
JObject test = JObject.Parse(auth_id);
string access_token = (string)test["access_token"];
string user_id = (string)test["user_id"];
string error = (string)test["error"];
This is my json code
{"access_token":"0533","expires_in":0,"user_id":1}
What did I do wrong?
Error was: check error may be null
I had an idea on how to make the code better. Error with null go away. But now all the variables are empty.
string error = "";
string user_id = "";
string access_token = "";
access_token = ((string)test["access_token"]) == null ? access_token : "";
user_id = ((string)test["user_id"]) == null ? user_id : "";
error = ((string)test["error"]) == null ? error : "";
test["access_token"] as stringinstead? I don't understand exactly the error.