title: Wildcard in WebAPI Route template
body: <p>I have set up a route template:</p>
  
  <pre><code>    config.Routes.MapHttpRoute(
          name: "DefaultApi",
          routeTemplate: "api/{controller}/{id}/{*wildcard}",
          defaults: new { id = RouteParameter.Optional }
          );
  </code></pre>
  
  <p>controller's action signature:</p>
  
  <pre><code>public IEnumerable&lt;object&gt; Get(Int64 id,string abc)
  </code></pre>
  
  <p>I tried to match it with URL <a href="http://mymachine.com/api/Individuals/1?abc=4" rel="noreferrer">http://mymachine.com/api/Individuals/1?abc=4</a>, but it gives me an exception </p>
  
  <blockquote>
    <p>{"$id":"1","Message":"An error has
    occurred.","ExceptionMessage":"Object reference not set to an instance
    of an
    object.","ExceptionType":"System.NullReferenceException","StackTrace":"
    at
    System.Web.Http.ValueProviders.Providers.RouteDataValueProvider.d__4.MoveNext()\r\n</p>
  </blockquote>
  
  <p>Strangely, <a href="http://mymachine.com/api/Individuals?id=1&amp;abc=4" rel="noreferrer">http://mymachine.com/api/Individuals?id=1&amp;abc=4</a> does match with the controller,action and parameters.</p>
  
  <p>I thought "<strong>{id}</strong>" of "api/{controller}/<strong>{id}</strong>/{*wildcard}" will work. </p>
  
  <p>Why?</p>