使用Web API时,遇到从客户端调用GET方法时的情况。Web API控制器中的多个GET方法
//This didn't worked
public IEnumerable<type> Get(string mode)
{
//Code
}
//This worked
public IEnumerable<type> Get(string id)
{
//Code
}
只改变参数的名称使我的调用成功。我正在使用默认路由。
该方法有什么问题。如果我想要一个具有多个参数的GET方法,该怎么办?例如:
pulbic string GET(string department, string location)
{
//Code here
}
ThanxBlll,它真的听起来是对问题的解释。该链接真的很有帮助。 –