有要求
var stroka = @"{""Items"":[{""Data"": null,""DataArray"":[],""Name"":""SessionToken"",""Value"":" + sessionToken + @"},{""Data"": null,""DataArray"":[],""Name"":""AuthToken"",""Value"":" + authToken + @"},{""Data"": null,""DataArray"":[],""Name"":""AuthorizationUser"",""Value"":" + value + @"}],""Value"":null}";
HttpWebRequest Updat = WebRequest.Create(String.Format($"http://127.0.0.1:8/API/REST/Entity/Update/{typeUid}/{ENTITYID}")) as HttpWebRequest;
Updat.Method = "POST";
Updat.Headers.Add("AuthToken", authToken);
Updat.Headers.Add("SessionToken", sessionToken);
Updat.Timeout = 100000;
Updat.ContentType = "application/json; charset=utf-8";
var sentData = Encoding.UTF8.GetBytes(stroka);
Updat.ContentLength = sentData.Length;
Stream sendStream = Updat.GetRequestStream();
sendStream.Write(sentData, 0, sentData.Length);
var res3 = Updat.GetResponse() as HttpWebResponse;
var resStream3 = res3.GetResponseStream();
var sr3 = new StreamReader(resStream3, Encoding.UTF8);
但是,正如我被告知的那样,这是一个旧用例,如何将其转换为新用例?
不赘述,结果会是这样
尽管我强烈建议您学习如何使用JSON 序列化。