C# 带参访问接口,WebClient方式
程序员文章站
2022-04-18 10:26:48
public static string GetPostString(string urladdress, string @params) { string returnValue = null; using (WebClient client = new WebClient()) { client ......
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;
}
-------------------------以上 为 与同事之间的接口查询-------------------------------------
上一篇: 怎么缩小vmware虚拟机空间?