Home  /  Questions  /  Question

50   50
Feb 20, 2013

Using $.ajax with a REST service that is built with WCF

In our app we're using $.ajax to post client data back to the server, but I keep on getting a 400 error. 
Can anyone tell me what is wrong here?   

     url: "http://localhost/restservices.svc/Document",
     type: "POST",
     data: '{source: "New York", type: "PDF"}',
     contentType: "application/json; charset=utf-8",
     success: function (message) { alert("success: " + message.status); },
     error: function (message) { alert("failure: " + message.status); }