1

How can I send data with post by xdr:

[OperationContract(Name = "app")]
[WebInvoke(Method = "POST", RequestFormat = WebMessageFormat.Json,UriTemplate="app",BodyStyle=WebMessageBodyStyle.Wrapped, ResponseFormat=WebMessageFormat.Json)]
bool ApplyJob(T_JOB_APPLYER_Entity Applyer);

i try do this but not work:

if (window.XDomainRequest) {
    xdr = new XDomainRequest();

    if (xdr) {
        xdr.onload = function () {
        CountWork($.parseJSON(xdr.responseText));
        }
        xdr.open("POST", url + "app", true);

        var data = JSON.stringify({ Applyer: { APPLYER_EMAIL: "John"}});
        xdr.send(data);
    }
}

If data is set to an empty string or is null it works, but if I want to send data it doesn't work.

PeeHaa
  • 71,436
  • 58
  • 190
  • 262

0 Answers0