I want to do a simple REST API for a functionality my webservice will expose.
[RoutePrefix("companies")]
public class CompaniesController : BaseApiController {
[HttpGet, Route("{companyId:int}")]
public CustomResponse Get(int companyId) { }
[HttpPost]
public CustomResponse Post(CompanySaveViewModel model) { }
[HttpDelete, Route("{companyId:int}"]
public CustomResponse Delete(int companyId) { }
}
Ok, this should be working. POST method is working fine. However, when I try to call GET and/or DELETE methods, I got the message below:
I'm trying to call those methods using the given URLs:
http://localhost:11111/api/companies/1 [GET]
http://localhost:11111/api/companies/1 [DELETE]
POST is working fine. When I try to call GET without parameters, it works fine as well. The problem appears when I have any kind of parameter for GET/DELETE methods. What could be the problem here?
Thank you all for the help!

RoutePrefixand try the same