// 1. Install-Package -Id Microsoft.AspNet.WebApi -Version 4.0.30506 -DependencyVersion HighestMinor // 2. Update-Package Newtonsoft.Json // 3. Install-Package -Id Microsoft.AspNet.WebApi.Tracing -Version 4.0.30506 // (it is Optional) // 4. Add - App_Start/WebApiConfig.cs WebApiConfig class { public static void Register(HttpConfiguration config) { config.Routes.MapHttpRoute( name: "DefaultApi", routeTemplate: "api/{controller}/{id}", defaults: new { id = RouteParameter.Optional } ); // Uncomment the following line of code to enable query support for actions with an IQueryable or IQueryable return type. // To avoid processing unexpected or malicious queries, use the validation settings on QueryableAttribute to validate incoming queries. // For more information, visit http://go.microsoft.com/fwlink/?LinkId=279712. //config.EnableQuerySupport(); // To disable tracing in your application, please comment out or remove the following line of code // For more information, refer to: http://www.asp.net/web-api config.EnableSystemDiagnosticsTracing(); } // 5. Add a Global.asax file and open the Global.asax.cs: protected void Application_Start() { WebApiConfig.Register(GlobalConfiguration.Configuration); } // 6. Add - Controllers/ValuesController.cs: public class ValuesController : ApiController // : ApiController !!! { // GET api/values public IEnumerable Get() { return new string[] { "value1", "value2" }; } // GET api/values/5 public string Get(int id) { return "value-" + id; } // POST api/values public void Post([FromBody]string value) { } // PUT api/values/5 public void Put(int id, [FromBody]string value) { } // DELETE api/values/5 public void Delete(int id) { } }