C# 带参访问接口,WebClient方式

it2022-05-09  18

public static string GetPostString(string urladdress, string @params) { string returnValue = null; using (WebClient client = new WebClient()) { client.Headers.Add("Content-Type", "application/x-www-form-urlencoded"); client.Encoding = Encoding.UTF8; returnValue = client.UploadString(urladdress, "POST", @params); } return returnValue; }

-------------------------以上 为  与同事之间的接口查询-------------------------------------

 

转载于:https://www.cnblogs.com/CSYgo/p/8548006.html

相关资源:C#中在WebClient中使用post发送数据实现方法

最新回复(0)