【发布时间】:2020-08-14 00:34:15
【问题描述】:
解析 Zoho Creator Rest API 返回时遇到问题。样本返回结果:
{{"formname":["RestAPI",{"operation":["add",{"values":{"Name":"Gary","Basic":"10000","Hobbies": ["Reading","Writing"],"DOB":"12-Jun-1980","Address":"USA","ID":89597000010897007},"status":"Success"}]}]}
使用下面的代码返回一个 JObject 以提取属性:
/* send post request here */
HttpContent _content = null;
var response = this.client.PostAsync(this.PostUrl,_content).Result;
/* parse request response here - need to record all data from return response */
string responseString = response.Content.ReadAsStringAsync().Result;
JObject result = JObject.Parse(responseString);
由于某种原因,我无法访问“结果”对象的任何属性。我尝试过使用索引和 JToken 方法,但都没有返回值。
【问题讨论】: