标签:
可以按照下面的写法来
app.controller("mycontroller", function ($scope, $http) {
$scope.login = function () {
var data = {
name: "1",
pwd: "1"
},
transFn = function (data) {
return JSON.stringify(data);
}, postCfg = {
headers: { ‘Content-Type‘: ‘application/x-www-form-urlencoded; charset=UTF-8‘ },
transformRequest: transFn
};
$http.post(‘/api/Values/Login‘, data, postCfg).success(function (responseData) {
alert(responseData);
});
}
})
angularJS的$http.post请求,.net后台接收不到参数值的解决方案
标签:
原文地址:http://www.cnblogs.com/lkd3063601/p/4798507.html