I have a Winform client that sends a json post request to my controller with a datetime value of the format dd/MM/yyyy and the call returns a status code 400.
I trie
If you are posting this via JSON then you should be able to create a JSON.NET converter for your date format.
In fact in researching this answer I found this full example on SO WebApi Json.NET custom date handling
Obviously just alter the conversion in MyDateTimeConvertor to be something that uses the current culture and the format you spefified.
DateTime.ParseExact(reader.Value.ToString(), "dd/mm/yyyy", CultureInfo.CurrentCulture);
AND
writer.WriteValue(((DateTime)value).ToString("dd/mm/yyyy"));
There's a pretty simple solution. Just add the CultureInfo to the JsonSerializerSettings in global.asax, method Application_Start().
GlobalConfiguration.Configuration.Formatters.JsonFormatter.SerializerSettings =
new JsonSerializerSettings
{
DateFormatHandling = DateFormatHandling.IsoDateFormat,
DateTimeZoneHandling = DateTimeZoneHandling.Unspecified,
Culture = CultureInfo.GetCultureInfo("fr-FR")
};