I want to make a Get request to my Backend, but I want to verify some user credentials before sending the response object.
Here is my code:
$scope.ge
You're most likely going to need to use a POST method instead of a GET method.
But to do it with a GET method:
From AngularJS passing data to $http.get request:
A HTTP GET request can't contain data to be posted to the server. However you can add a query string to the request.
angular.http provides an option for it params.
$http({
url: user.details_path,
method: "GET",
params: {user_id: user.id}
});
And using AngularJS to POST instead:
$http.post('/someUrl', {msg:'hello word!'}).
then(function(response) {
// this callback will be called asynchronously
// when the response is available
}, function(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});