http post 使用 RestSharp 调用

1、管理nuget包,搜索 RestSharp 程序版本选择 105.2.3

 

 安装后 使用方式为

 var client = new RestClient(url);
                client.Timeout = -1;
                var request = new RestRequest(Method.POST);
                request.AddHeader("Content-Type", "application/json");
                var body = sPara.ToString();
                request.AddParameter("application/json", body, ParameterType.RequestBody);
                IRestResponse response = client.Execute(request);
                result.return_type = "S";
                result.return_message = respo

C#Nuget 包官网链接:https://www.nuget.org/downloads

RestSharp Version:105.2.3

Install-Package RestSharp -Version 105.2.3

你可能感兴趣的