我想在 angularjs 中更改 post['Content-Type'] 所以我使用
app.config(function($locationProvider,$httpProvider) {
$locationProvider.html5Mode(false);
$httpProvider.defaults.useXDomain = true;
delete $httpProvider.defaults.headers.common['X-Requested-With'];
$httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8';
});
事件是
$http.post("http://172.22.71.107:8888/ajax/login",{admin_name:user.u_name,admin_password:user.cert})
.success(function(arg_result){
console.log(arg_result);
});
};
但是结果是
Parametersapplication/x-www-form-urlencoded
{"admin_name":"dd"}
我想要的是
Parametersapplication/x-www-form-urlencoded
admin_name dd
那我该怎么办?