ajaxPost请求,后台接受的是string类型,对象传json报文可以成功,但是传个xml报文就报错request:obj.request这个request后台接收的是string类型,前台obj.request是json就没问题,但是传个xml报文就报错。请各位大神帮忙看看怎么解决?SaveInterface:function(){varobj=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("保存失败");}});
小怪兽爱吃肉
相关分类