API使用dynamic 传参
2021-03-04 00:25
标签:str code message http 数据库 pos out name EAP 添加 API使用dynamic 传参 标签:str code message http 数据库 pos out name EAP 原文地址:https://www.cnblogs.com/zxianqing/p/12955978.html [HttpPost]
public HttpResponseMessage FingerMatchApi(dynamic obj) //动态类型参数 接收Json字符串
{
string sysName = Convert.ToString(obj.sysName);
string loginId = Convert.ToString(obj.loginId);
string strTZ = Convert.ToString(obj.strTZ);
string vendor = Convert.ToString(obj.vendor);
}
//调用WebApi进行指纹匹配
public void FpMatchUseApi(string loginId, string tz, string arg)
{
try
{
string url = "http://~/api/FingerMatch/FingerMatchApi"; //办公网测试API 访问的是10.243.16.61上面的Finger数据库
string postData = "";
string status = "";
var obj = new { sysName = "指纹录入系统", loginId = loginId, strTZ = tz, vendor = arg };
postData = JsonHelper.Add_ToJson(obj);
string result = ApiHelper.PostResponse(url, postData, out status); //调用指纹API
}
}
上一篇:windows提权方法