Skip to content

Instantly share code, notes, and snippets.

@benjamincharity
Created June 2, 2015 19:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save benjamincharity/5aed3191db63cf450ce5 to your computer and use it in GitHub Desktop.
Save benjamincharity/5aed3191db63cf450ce5 to your computer and use it in GitHub Desktop.
Http post with external request object.
var req = {
method: 'POST',
url: ENV.API_END_POINT + '/users',
headers: {
'Authorization': 'Basic ' + Base64Service.encode(mUser + ':' + mPass)
},
data: user
};
$http(req)
.success(function(data) {
deferred.resolve(data);
})
.error(function(data) {
deferred.reject(data);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment