4代TH4XW/TH4XG 调用易维联云平台api的C# demo
var httpWebRequest = (HttpWebRequest)WebRequest.Create("http://www.1weilian.com:8750/mtInterface/realTime/getRealTime");
httpWebRequest.ContentType = "application/json";
httpWebRequest.Method = "POST";
using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream()))
{
string json = "{\"clientId\":\"66675e88c7c64bea91f649e04xxxxxx\"," +
"\"rows\":\"2\","+
"\"page\":\"0\"}";
streamWriter.Write(json);
streamWriter.Flush();
streamWriter.Close();
}
var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse();
using (var streamReader = new StreamReader(httpResponse.GetResponseStream()))
{
var result = streamReader.ReadToEnd();
}