Разбор ответа JSON в C #
Я получаю ответ JSON после выполнения запроса к API.
JSON похож на:
{
"results": [
{
"alternatives": [
{
"confidence": 0.965,
"transcript": "how do I raise the self esteem of a child in his academic achievement at the same time "
}
],
"final": true
},
{
"alternatives": [
{
"confidence": 0.919,
"transcript": "it's not me out of ten years of pseudo teaching and helped me realize "
}
],
"final": true
},
{
"alternatives": [
{
"confidence": 0.687,
"transcript": "is so powerful that it can turn bad morals the good you can turn awful practice and the powerful once they can teams men and transform them into angel "
}
],
"final": true
},
{
"alternatives": [
{
"confidence": 0.278,
"transcript": "you know if not on purpose Arteaga Williams who got in my mother "
}
],
"final": true
},
{
"alternatives": [
{
"confidence": 0.621,
"transcript": "for what pink you very much "
}
],
"final": true
}
],
"result_index": 0
}
Я должен сделать две вещи, чтобы результат json выше (я сохраняю это как строку *):
Получите расшифровку части (й) ответа json.Обработайте эти строки.
Я новичок в этом. Преобразование в строку называется только сериализацией. Почему десериализация поможет здесь?Преобразование в строку: я сделал это с помощью:
var reader = new StreamReader(response.GetResponseStream());
responseFromServer = reader.ReadToEnd();
Как этого добиться?