title: Optional DateTime Web API
body: <p>I have a class like this:</p>
  
  <pre><code>public class FooController : ApiController
      {
          [System.Web.Http.Route("live/topperformers")]
          [System.Web.Http.AcceptVerbs("GET", "POST")]
          [System.Web.Http.HttpGet]
          public List&lt;string&gt; GetTopPerformers()
          {
              return new List&lt;string&gt;();
          }
  }
  </code></pre>
  
  <p>When I access it by going to "<a href="http://foo.com/live/topperformers" rel="noreferrer">http://foo.com/live/topperformers</a>", it works great. So now I want to add an optional DateTime param to this method, so I modify the method to take a DAteTime param, and make it nullable.</p>
  
  <pre><code>public class FooController : ApiController
      {
          [System.Web.Http.Route("live/topperformers/{dateTime:DateTime}")]
          [System.Web.Http.AcceptVerbs("GET", "POST")]
          [System.Web.Http.HttpGet]
          public List&lt;string&gt; GetTopPerformers(DateTime? dateTime)
          {
              return new List&lt;string&gt;();
          }
  }
  </code></pre>
  
  <p>When I try to access the URL without a parameter, the same as I access before - it gives a 404. Pasing in the date value like " like "<a href="http://foo.com/live/topperformers/2010-01-01" rel="noreferrer">http://foo.com/live/topperformers/2010-01-01</a>" works fine. But without the date, it gives 404.</p>
  
  <p>I thought Web API supported optional params in this fashion? I can simply overload and have both versions, but is this possible with just one method?</p>