页面内容为: {"status":200,"success":true,"message":"OK","content":{"version":"1687838311117","url":"https://baidu.com"}}
string url = "http://127.0.0.1:xxxx";
UnityWebRequest req = new UnityWebRequest(url);
DownloadHandlerBuffer dH = new DownloadHandlerBuffer();
req.downloadHandler = dH;
req.timeout = 10000;
yield return req.SendWebRequest();
//System.Collections.Generic.Dictionary<string, string> dic_result = req.GetResponseHeaders();
//foreach (var head in dic_result)
//{
// Debug.Log("head =" + head);
//}
Debug.Log("req.isNetworkErrorZ:" + req.isError);
Debug.Log("text =" + req.downloadHandler.text);
Debug.Log("req.result:" + req.downloadHandler.data.Length);
JObject jsonObject = JsonConvert.DeserializeObject <JObject> (req.downloadHandler.text);
JObject sobject = jsonObject.Value<JObject>("content");
Debug.Log(sobject);
string s = sobject.Value<string>("url");
Debug.Log(s);