var client = new RestClient("http://192.168.2.155:8899/user/getTroubleInfo");
var request = new RestRequest(Method.POST);
request.AddHeader("content-type", "application/x-www-form-urlencoded");
request.AddParameter("application/x-www-form-urlencoded", "name=1#失控落棒1#&createtime=2024-01-02 11:24:04&time=&flag=1&path=1#CST-->LOCA-->稳压器水位1#-->稳压器压力-->电加热器热功率", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
C# 请求服务端方式2
最新推荐文章于 2024-08-10 09:16:23 发布
博客展示了使用C#进行Rest请求的代码。创建RestClient实例,指定请求地址,设置请求方法为POST,添加请求头和请求体参数,最后执行请求获取响应,用于获取故障信息。
1万+

被折叠的 条评论
为什么被折叠?



