Take only value from json

FurnariFurnari Member ✭✭

Hi everyone,
after deserialize a json, how i can take only the value of "id_token" into a string?

there is my json

{
"id_token": "XXXXXXXXXXXXXXX.XXXXXXXXXXXXXXXXXXXXXX.XXXXXXXXXXXXX"
}

Thanks in advance.

Tagged:

Best Answer

Answers

  • FurnariFurnari Member ✭✭

    @JoeManke my json is not always the same, then i parse the content of response.

    Here is the code :

    var content = response.Content;

    var jsonObject = JObject.Parse(content);
    string token = jsonObject.Value("id_token");

    token contains only the value.

    Thanks a lot.

Sign In or Register to comment.