Created
May 15, 2014 20:21
-
-
Save tristar500/abbe77595ff91d79801a to your computer and use it in GitHub Desktop.
Send $_POST using AngularJS
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
/// ****************************************** | |
/// | |
/// There are crazy gyrations required post data from angular. | |
/// http://stackoverflow.com/questions/11442632/how-can-i-make-angular-js-post-data-as-form-data-instead-of-a-request-payload | |
/// | |
/// ****************************************** | |
var xsrf = $.param(selectedItem); | |
$http({ | |
method: "POST", | |
url: 'updateuser', | |
headers: {'Content-Type': 'application/x-www-form-urlencoded'}, | |
data: xsrf | |
}) | |
.success(function( result, status){ | |
}) | |
.error(function( result, status){ | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment