diff options
| author | Pliable Pixels <pliablepixels@gmail.com> | 2018-07-12 15:58:13 -0400 |
|---|---|---|
| committer | Pliable Pixels <pliablepixels@gmail.com> | 2018-07-12 15:58:13 -0400 |
| commit | 8c280aa571af3653a62842679facf6cc03fb909a (patch) | |
| tree | 62f69cd71fde0b16089be80d8078053c6a9efd84 /www | |
| parent | d9ca83b42a6bf4dfc125973d662da683ac9eabf3 (diff) | |
#668 switch to POST
Diffstat (limited to 'www')
| -rwxr-xr-x | www/js/app.js | 18 |
1 files changed, 15 insertions, 3 deletions
diff --git a/www/js/app.js b/www/js/app.js index e6bce4bd..752eaaa1 100755 --- a/www/js/app.js +++ b/www/js/app.js @@ -1032,9 +1032,21 @@ angular.module('zmApp', [ //first login using new API - var loginAPI = loginData.apiurl + '/host/login.json?user=' + loginData.username + "&pass=" + loginData.password; - - $http.get(loginAPI) + var loginAPI = loginData.apiurl + '/host/login.json'; + + $http({ + method:'POST', + url: loginAPI, + headers: {'Content-Type': 'application/x-www-form-urlencoded'}, + transformRequest: function(obj) { + var str = []; + for(var p in obj) + str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p])); + return str.join("&"); + }, + data: {user: loginData.username, pass: loginData.password} + }) + //$http.get(loginAPI) .then(function (succ) { NVRDataModel.debug ("API based login returned: "+JSON.stringify(succ)); |
