Home > front end >  Post submission json to the webservice, prompt "Web service invocation is invalid, parameter&qu
Post submission json to the webservice, prompt "Web service invocation is invalid, parameter&qu

Time:09-30

Through the change of the server to add Access - Control - Allow - Origin * the get method is normal, but the post has been walking error, don't know what the reason, consultation, thank you,
 $. Ajax ({
Type: "POST",
ContentType: "application/json; Charset=utf-8,
"DataType: "json",
Url: "https://www.baidu.ink/ProjectService.asmx/CreateProject",//address is modified,
//data: {" jsonStr ": jsontr},
Data: jsontr,//var jsontr=JSON. The stringify (object);
CrossDomain: true==! (document. All),//ie 10 browser need to add the below!!
Success: the function () {
//the console. The log (data);
Alert (" the call is successful, ");
Alert (data);
},
Error: function () {
Alert (" call fails: "); }
});
});

CodePudding user response:

The
Data: jsontr,//var jsontr=JSON. The stringify (object);
Change
Data: {... Object},//use your object, do not use a json string
  •  Tags:  
  • Ajax
  • Related