1
我們如何調用下面的web api?用多個字符串參數調用Post Web API?
[HttpPost]
public bool ValidateAdmin(string username, string password)
{
return _userBusinessObject.ValidateAdmin(username, password);
}
我已經寫了下面的代碼,但它這麼想的工作404 (Not Found)
string url = string.Format("api/User/ValidateAdmin?password={0}", password);
HttpResponseMessage response = Client.PostAsJsonAsync(url, username).Result;
response.EnsureSuccessStatusCode();
return response.Content.ReadAsAsync<bool>().Result;
編輯:
我死了肯定的URL,但它說404 (Not Found)