While testing my API in Browser, only the Get method is called.
When I browse http://localhost:xxxxx/api/student/GetStudentById/38 I get the correct value from Database. Here GetStudentById is the [ActionName] under [HttpGet].
But when I browse http://localhost:xxxxx/api/student/StudentDeleteById/38 I get "The requested resource does not support http method 'GET'." (Why it is getting Redirected to Get)? Here StudentDeleteById is the [ActionName] under [HttpDelete].
I have tested my API in Postman every Request is executing successfully(i.e Get, Put, Post, Delete)
Below is my WebApiConfig.cs
config.Routes.MapHttpRoute(
name: "DefaultApi",
routeTemplate: "api/{controller}/{action}/{id}",
defaults: new { id = RouteParameter.Optional }
);