ajax Post request, the backend accepts the string type. The object can send a json message successfully, but send an error
request: obj.request. The request backend receives the string type. The foreground obj.request is json, but an error is reported when the xml message is sent. Would you please help me to see how to solve it?
SaveInterface: function () {
var obj = this.template;
console.log(obj.requestType);
console.log(obj.request);
if (obj.interfacename == "" || obj.request == "") {
alert("Request");
}
else {
var $promise = $.ajax({
url: "@Url.Action("CreateInterface")",
type: "post",
dataType: "json",
data: { serviceName: obj.ServiceName, interfaceName: obj.interfacename, requestType: obj.requestType, request: obj.request }
});
$promise.done(function (result) {
if (result.isSuccess) {
alert("");
//
vm.interfaceNames.push(obj.interfacename);
art.dialog.opener.art.dialog.list["Addinterface"].close();
}
else {
alert("");
}
});