WebApi调用通用方法
2021-03-27 08:24
标签:code 一个 auth minutes 动态类型 users amp turn wan 后端WebApi代码如下: WebApi调用通用方法 标签:code 一个 auth minutes 动态类型 users amp turn wan 原文地址:http://blog.51cto.com/3544640/2149406 try
{
WebClient client = new WebClient();
//client.QueryString.Add("account", "冯宝宝");
//client.QueryString.Add("password", "7777");
client.QueryString.Add("name", "冯宝宝");
client.Encoding = Encoding.UTF8;
client.Headers.Add(HttpRequestHeader.ContentType, "application/json");
//string result = client.UploadString("http://localhost:51151/Api/Users/Login", "");
string result = client.UploadString("http://localhost:51151/Api/Users/WithStringParamNoFromBody", "");
}
catch (Exception ex)
{
}
[AllowAnonymous]
[HttpPost]
public IEnumerable
上一篇:C#与西门子PLC通讯