Other Parts Discussed in Thread: CC3200, CC3200SDK, ENERGIA, UNIFLASH
Hi,
I have connected CC3200 to Google API and send HTTP POST and i have a few questions about response data
1/ when the request POST send successfully and Google is 100% confident in it's translation,
It will return the following object:
{
"result":[
{
"alternative":[
{
"transcript":"this is a test",
"confidence":0.97321892
},
{
"transcript":"this is a test for"
}
],
"final":true
}
],
"result_index":0
}
So I have to use lRetVal = readResponse(httpClient); (at the end of function HTTPPostMethod) to receive the return data
if i use readResponse, i have to change the ids field
const char *ids[5] = {
HTTPCli_FIELD_NAME_CONTENT_LENGTH,
HTTPCli_FIELD_NAME_CONNECTION,
HTTPCli_FIELD_NAME_CONTENT_TYPE,
"result",
NULL
};
Do you have any solution to get the value " transcript: this a test " from return value
Would you mind helping me
2/ the result after i debugged the code.
why after this line
if(!strncmp((const char *)g_buff, "application/json",
sizeof("application/json")))
the result is json = 0
In the second picture, the g_buff contains application/json; . Why json = 0
I tested with Postma and it is true that it is not json. Can only be read by XML type , HTML type , Text type . But i still wonder why json = 0
Thank you and Best regards,
Khoa






