title: Using HttpClient to Send Dates in URL Using AttributeRouting
body: <p>I'm having some problems getting a date range query accepted by my WebAPI.  As as far as I can tell from everything I've read this should be working but I still get <code>400 Bad Request</code> responses.</p>
  
  <p>My API route looks like this:</p>
  
  <pre><code>    [System.Web.Http.HttpGet]
      [GET("range/{start:datetime}/{end:datetime}")]
      public HttpResponseMessage Get(DateTime start, DateTime end)
  </code></pre>
  
  <p>I'm using the <code>AttributeRouting</code> library and according to <a href="http://www.asp.net/web-api/overview/web-api-routing-and-actions/create-a-rest-api-with-attribute-routing" rel="nofollow">this page</a> the URL I'm requesting should be fine.</p>
  
  <p>My request URL looks like this:</p>
  
  <pre><code>http://localhost:51258/plots/range/2013-07-29T21:58:39/2013-08-05T21:58:39
  </code></pre>
  
  <p>I have this set on the controller <code>RoutePrefix("plots")</code> which is where the <code>plots</code> bit of the URL route comes from.</p>
  
  <p>If I strip the times off the <code>DateTime</code> objects everything works fine but I need the times passed.</p>