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

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;
}

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

 

posted @ 2018-03-12 10:48  GOGOGO陈  阅读(1492)  评论(0编辑  收藏  举报