Last active
July 5, 2016 08:16
-
-
Save FreeFly19/442772804572f16c4e8f7d4db8296eee to your computer and use it in GitHub Desktop.
jQuery Params instead encodeURLComponent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var data = "username=" + encodeURIComponent($scope.username) + | |
| "&password=" + encodeURIComponent($scope.password); | |
| $http({ | |
| method: 'POST', | |
| url: 'login', | |
| data: data, | |
| headers: { | |
| 'Content-Type': 'application/x-www-form-urlencoded' | |
| } | |
| }).then(...); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $http({ | |
| method: 'POST', | |
| url: 'login', | |
| data: $.param({ | |
| username: $scope.username, | |
| password: $scope.password | |
| }), | |
| headers: { | |
| 'Content-Type': 'application/x-www-form-urlencoded' | |
| } | |
| }).then(...); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment