Skip to content

Instantly share code, notes, and snippets.

@mlynch
Created August 18, 2014 19:07
Show Gist options
  • Save mlynch/622a39633c3c5814a779 to your computer and use it in GitHub Desktop.
Save mlynch/622a39633c3c5814a779 to your computer and use it in GitHub Desktop.
post for mdata
$http({
method: 'POST',
url: apiUrl + '/signup',
headers: {'Content-Type': 'application/x-www-form-urlencoded'},
data: data,
transformRequest: function(obj) {
var str = [];
for( var p in obj )
str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
return str.join("&");
},
}).then(function(resp) {
return q.resolve(resp.data);
}, function(err) {
return q.reject(err);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment