I know that are a lot of posts about consuming a WCF REST through JQuery/JSON, but I can\'t get it to work. I\'m currently stuck at a date parameter. Below is my C# method:<
Building over the answer by @vas above:-
// OrderRecievedDateTime is a proper date string
var tStart = new Date(OrderRecievedDateTime);
// Get date in UTC (required for WCF) as morning
var start = new Date(Date.UTC(tStart.getFullYear(), tStart.getMonth(), tStart.getDate(), 0, 0, 0));
// Get the ticks
var startTicks = start.getTime();
// Now build the JSON param (**notice I am passing the date value as a string, by including within quotes. Without this it doesn't takes it**).
var paramRequest = '{ "request": { "StartDate":"' + '\/Date(' + startTicks + ')\/"' + ' } }';
// Hit ajax, no need of any JSON.parse or stringify
$.ajax({ ..., data = paramRequest ..});
WCF receives the date in proper format. Important addition is how we passed the date in JSON as a string. Can be further simplified as follows by combining the key and start of /Date string
var paramRequest = '{ "request": { "StartDate":"\/Date(' + startTicks + ')\/" } }';