hi,
I have controller
namespace MyServer.Controllers { public class Status1 : ApiController { // GET api/<controller> [HttpGet] public IEnumerable<string> Get() { return new string[] { "value1", "value2" }; } } }
and in WebApiConfig:
namespace MyServer { public static class WebApiConfig { public static void Register(HttpConfiguration config) { // Web API configuration and services // Web API routes config.MapHttpAttributeRoutes(); config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); } } }
When I call form postman
http://localhost:50068/api/Status1
i get message
{"Message":"No HTTP resource was found that matches the request URI 'http://localhost:50068/api/Status1'.","MessageDetail":"No type was found that matches the controller named 'Status1'."}
Please help