I have the following ASP.NET WebApi controller:
public class FooController : ApiController
{
public string Get(DateTime id)
{
...
}
}
How does the request need to be formatted? I'm getting 400s (Bad Request). Can someone give me an example of a URL to ApiController
's Get()
with a DateTime, please?
This will work:
http://localhost:2619/api/Foo/2014-09-14
But this will not:
http://localhost:2619/api/Foo/2014-09-14T18:52:00.000Z
And neither will encoding it:
http://localhost:2619/api/Foo/2014-09-14T18%3A52%3A00.000Z
The DateTime I send needs to be expressed as UTC.