backupApp.service('authenticationApiConnector', function($http) {

    const transformRequest = (obj) => {
        var str = [];
        for(var p in obj) {
            var arg = obj[p] == null ? '' : encodeURIComponent(obj[p]);
            str.push(encodeURIComponent(p) + "=" + arg);
        }
        return str.join("&");
    }

    this.post = function (uri, body) {
        const requestBody = transformRequest(body);
        const requestOptions = {
            headers: {'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'}
        };

        return $http.post(uri, requestBody, requestOptions);
    }
})