I have a method defined in ApiController. When the method is defined like this :
public IEnumerable<QuestionResponse> Get()
Everything is fine. However I want to pass a parameter to that method but when I define that method as
public IEnumerable<QuestionResponse> Get(int parid)
The response is a 405 "The requested resource does not support http method 'GET'".
When there's no parameter defined for the method then both of these urls are routed to the method :
/api/questionresponse/224809
/api/questionresponse
But when I define an argument to that method both of those urls result in a 405 .
Help ?
FWIW
- the request is being made from some jquery on a page served from within the same project
- I've based what I've done to date on this text http://www.asp.net/web-api/overview/getting-started-with-aspnet-web-api/tutorial-your-first-web-api .
- the results I'm describing here are all when run from within Visual Studio 2015 .