Sorry if you think this is a duplicate to this one but it didn't resolve my issue.
I have a WebApi method like:
[AcceptVerbs("GET")]
[ActionName("Search")]
public EmpResults GetSearchResults([FromUri] string country, [FromUri] List<int> depts)
{
EmpResults emps = m_controller.Search(country, depts);
return emps;
}
and the routing table looks like:
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapHttpRoute("IMO Route",
"employees/search/{country}/{depts}",
new
{
controller = "Employee",
action = "Search"
});
}
I am not sure how can I test this WebApi through simple browser bar?
I have tried the this with some success, it returns the list of employees for department 10:
http://localhost/WebApi.Employee/employee/search/brazil/10?connString=Provider...
but I was not able to find a way to pass a list of depts like 10, 20, 40. Appreciate any help.