title: Angular $http attach data as object
body: <p>I'm trying to get list of tracks from soundcloud API with angularjs.<br/>
  The parameters i'm trying to send are: <br/>
  1) client_id (string) <br/>
  2) duration (object with two properties). </p>
  
  <p>Here's the code: </p>
  
  <pre><code>    var CLIENT_ID = 'a81f01ef5d0036415431e8be76c8db0e';
      var TRACKS_URL = 'https://api.soundcloud.com/tracks.json';
  
      var app = angular.module('soundcloud', []);
  
      app.controller('tracksController', function ($scope, $http) {
  
          $http({
              url: 'https://api.soundcloud.com/tracks.json',
              method: 'GET',
              data: {
                  client_id: CLIENT_ID,
                  duration: { // in milliseconds
                      from: 300000,
                      to: 400000
                  }
              }
          })
              .success(function (data) {
                  $scope.trackList = data;
              })
              .error(function () { alert('error'); });
      });
  </code></pre>
  
  <p>These parameters aren't recognized at all when I check the request in the broweser's debugger. </p>
  
  <p>I tried to use 'params' instead of 'data', but this way it turns the 'duration' object to json --> then I get status 500 in response. <br />
  When I only send the client_id in params, it works fine because there's no object, only string.</p>
  
  <p>jQuery's ajax method works fine: <a href="https://jsfiddle.net/oacwz1up/3/" rel="nofollow">https://jsfiddle.net/oacwz1up/3/</a></p>
  
  <p>What should I do ? How can I send the parameters normally ? <br/>
  Help please! Thanks! </p>