从MVC应用程序将IP地址作为字符串发送到WebAPI GetMethod无法正常工作

时间:2019-07-14 07:46:03

标签: asp.net-web-api

我正在使用GET方法将某些字符串数据从MVC控制器发送到Web API client.GetAsync方法,但是当我在该字符串中附加IP address时,方法调用将不起作用。 / p>

string id;
id = Request.Browser.Browser;
id += "|" + Request.UserHostAddress;
client.BaseAddress = new Uri("http://localhost:1234/");
var responseTask = client.GetAsync("api/" + controllerName + "/" + id);

0 个答案:

没有答案