title: call to web api with string parameter
body: <p>I have a web api where I have 2 methods, one without parameter and two with different types of parameter (string and int). When calling the string method it doesnt work...what am I missing here?</p>
  <pre><code>public class MyControllerController : ApiController
  {
      public IHttpActionResult GetInt(int id)
      {
          return Ok(1);
      }
  
      public IHttpActionResult GetString(string test)
      {
          return Ok(&quot;it worked&quot;);
      }
  }
  </code></pre>
  <p>WebApiConfig.cs:</p>
  <pre><code>public static void Register(HttpConfiguration config)
  {
      // Web API configuration and services
  
      // Web API routes
      config.MapHttpAttributeRoutes();
  
      config.Routes.MapHttpRoute(
          name: &quot;DefaultApi&quot;,
          routeTemplate: &quot;api/{controller}/{id}&quot;,
          defaults: new { id = RouteParameter.Optional }
      );
  }
  </code></pre>
  <p>My Call:</p>
  <blockquote>
  <p>/api/MyController/MyString //Doesnt work</p>
  <p>/api/MyController/1 //work</p>
  </blockquote>
  <p>I get following error:</p>
  <blockquote>
  <p>The parameters dictionary contains a null entry for parameter 'id' of non-nullable type 'System.Int32' for method 'System.Web.Http.IHttpActionResult GetInt(Int32)' in 'TestAngular.Controllers.MyControllerController'. An optional parameter must be a reference type, a nullable type, or be declared as an optional parameter.</p>
  </blockquote>
  <p>What am I missing in my request?</p>