title: Optional query string parameters in ASP.NET Web API
body: <p>I need to implement the following WebAPI method:</p>
  
  <pre><code>/api/books?author=XXX&amp;title=XXX&amp;isbn=XXX&amp;somethingelse=XXX&amp;date=XXX
  </code></pre>
  
  <p>All of the query string parameters can be null. That is, the caller can specify from 0 to all of the 5 parameters.</p>
  
  <p>In <strong>MVC4 beta</strong> I used to do the following:</p>
  
  <pre><code>public class BooksController : ApiController
  {
      // GET /api/books?author=tolk&amp;title=lord&amp;isbn=91&amp;somethingelse=ABC&amp;date=1970-01-01
      public string GetFindBooks(string author, string title, string isbn, string somethingelse, DateTime? date) 
      {
          // ...
      }
  }
  </code></pre>
  
  <p>MVC4 RC doesn't behave like this anymore. If I specify fewer than 5 parameters, it replies with a <code>404</code> saying:</p>
  
  <blockquote>
    <p>No action was found on the controller 'Books' that matches the request.</p>
  </blockquote>
  
  <p>What is the correct method signature to make it behave like it used to, without having to specify the optional parameter in the URL routing?</p>