// Simple GET request example:
$http({
method: 'GET',
url: '/someUrl'
}).then(function successCallback(response) {
// this callback will be called asynchronously
// when the response is available
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
// POST
var req = {
method: 'POST',
url: 'http://example.com',
headers: {
'Content-Type': "application/json; charset=utf-8"
},
data: { test: 'test' }
}
$http(req).then(function(){...}, function(){...});