When you have multiple get methods in a web api controller like below.
public class WebApiController : ApiController { private IMyInterface _iMyInterface = null; public WebApiController(IMyInterface iMyInterface) { _iMyInterface = iMyInterface; } [HttpGet] public string GetName() { return _iMyInterface.Name; } [HttpGet] public string GetTest() { return _iMyInterface.Name; } }
Then you try to call ‘http://localhost:58956/api/WebApi/GetName‘ you may get an error like.
“ExceptionMessage”:”Multiple actions were found that match the request:
This is a simple route issue.The default route setting in WebApiConfig is shown below.
Change the above to.
You must be logged in to post a comment.