【发布时间】:2015-03-17 22:18:08
【问题描述】:
我正在尝试在 Angular 应用程序上设置 $http 的默认值,所以我有:
var application = angular.module('Application', ['ngDialog', 'validation']).config(function ($http) {
$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded";
});
这会引发错误。如何以及在哪里可以设置 $http 的默认值?
【问题讨论】:
标签: javascript angularjs http-headers angularjs-http misuse