2
我看了一下AngularJS POST请求头是application/json
但我想将其更改为:
Content-Type=application/x-www-form-urlencoded; charset=UTF-8
我做以下,但POST请求仍然使用相同的application/json
送到这里是角:
$http.post("server.php", checkUserPostData,
{"headers" : "Content-Type=application/x-www-form-urlencoded; charset=UTF-8"})
.success(function(data, status, header, config){
if(data=='exists')
return true;
else return false;
});
我应该如何设置请求的配置标题呢?
可能重复[AngularJS - 任何方式为$ http.post发送请求参数,而不是JSON?](http://stackoverflow.com/questions/12190166/angularjs-any-way-for-http-后到发送请求参数,INSTEAD-OF-JSON) –