Analisar a resposta JSON em c #
Recebo uma resposta json depois de fazer uma consulta a uma API.
O JSON é como:
{
"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
}
Eu tenho que fazer duas coisas acima do resultado do json (eu mantenho como uma string *):
Obtenha as partes da transcrição da resposta json.Processe essas strings.
Eu sou novo nisso. A conversão em string é chamada apenas de serialização. Por que a desserialização ajudaria aqui?Convertendo em string: eu fiz isso usando:
var reader = new StreamReader(response.GetResponseStream());
responseFromServer = reader.ReadToEnd();
Como conseguir isso?