From cfe4616c4af86743aa6771f427be98dc4412433b Mon Sep 17 00:00:00 2001 From: manzerbredes Date: Sun, 7 Feb 2016 11:10:44 +0100 Subject: [PATCH] Configure http provider --- client/js/app.js | 12 ++++++++++-- client/js/requests/identity.js | 3 +-- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/client/js/app.js b/client/js/app.js index 451df66..90fae89 100644 --- a/client/js/app.js +++ b/client/js/app.js @@ -6,9 +6,11 @@ var mainApp=angular.module("mainApp",['ngRoute', 'ngSanitize']); /** - * Configure the router + * Configure routeProvider */ mainApp.config(['$routeProvider', function($routeProvider){ + + $routeProvider. when('/home',{ templateUrl: 'partials/home/main.html', @@ -22,5 +24,11 @@ mainApp.config(['$routeProvider', function($routeProvider){ }); }]); - +/** + * Configure httpProvider + */ +mainApp.config(['$httpProvider', function($httpProvider){ + $httpProvider.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded; charset=UTF-8'; + +}]); diff --git a/client/js/requests/identity.js b/client/js/requests/identity.js index b2c7273..be3f4f8 100644 --- a/client/js/requests/identity.js +++ b/client/js/requests/identity.js @@ -28,8 +28,7 @@ identity.requestParser = {}; */ identity.request.login=function($http,username, password,projectname){ return $http.post('../server/index.php', - $.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname}), - {headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=UTF-8'}}); + $.param({"task" : "Authenticate", "user" : username, "password" : password, "project" : projectname})); };