title: Setting Up and API inside ASP.net (URL issues?)
body: <p>Now i realise this question may get voted down a bit because its not really a direct problem. I am very confident in C# and JavaScript ... so i decided to finally learn ASP.net (.net framework). I understand what API's and AJAX calls do such as handling data and starting API function to retrieve data. But how do you connect the two together inside a project? </p>
  
  <p><strong>This is the WEBAPI.config</strong></p>
  
  <pre><code> namespace SignalRDbUpdates
   {
     public static class WebApiConfig
     {
      public static void Register(HttpConfiguration config)
      {
          config.MapHttpAttributeRoutes();
  
  
          config.Routes.MapHttpRoute(
              name: "DefaultApi",
              routeTemplate: "api/{controller}/{id}",
              defaults: new { id = RouteParameter.Optional }
          );
      }
   }
  }
  </code></pre>
  
  <p><strong>Here is the API i have not set anything up on it yet just want to know how to start an AJAX call to this API ... maybe simply return a string to an alert box for now.</strong> </p>
  
  <pre><code>namespace DotNetFramework.Controllers.API
  {
  public class TestAPI : ApiController
  {
      // GET api/&lt;controller&gt;
      public IEnumerable&lt;string&gt; Get()
      {
          return new string[] { "value1", "value2" };
      }
  
      // GET api/&lt;controller&gt;/5
      public string Get(int id)
      {
          return "value";
      }
  
      // POST api/&lt;controller&gt;
      public void Post([FromBody]string value)
      {
      }
  
      // PUT api/&lt;controller&gt;/5
      public void Put(int id, [FromBody]string value)
      {
      }
  
      // DELETE api/&lt;controller&gt;/5
      public void Delete(int id)
      {
      }
  }
  }
  </code></pre>
  
  <p><strong>This is the AJAX call the URL posting is what confuses me, and expansion of AJAX get too would be appreciated</strong></p>
  
  <pre><code>$.ajax({
                 method: 'POST',
                 url: '?',
                 success: function()
                 {
                     alert('Working');
                  },
                  error: function()
                  {
                      alert('Error');
                  }
              });
  </code></pre>
  
  <p>To recap all i want to know how does using an API with AJAX actually work on a basic level of calling and sending data and retrieving and getting data from the API. The URL section of this is what confuses me the most. </p>