AngularJS passing data to $http.get request

The Solution to AngularJS passing data to $http.get request is


An 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 called params.

$http({
    url: user.details_path, 
    method: "GET",
    params: {user_id: user.id}
 });

See: http://docs.angularjs.org/api/ng.$http#get and https://docs.angularjs.org/api/ng/service/$http#usage (shows the params param)

~ Answered on 2012-12-07 09:34:11


Most Viewed Questions: