title: How to $http.post with payload in data?
body: <p>How do I post data from a form in AngularJS?</p>
  
  <pre class="lang-html prettyprint-override"><code>&lt;form data-ng-submit="doSomething()"&gt;
      &lt;input type="text" data-ng-input="do_obj.text"/&gt;
      &lt;input type="email" data-ng-input="do_obj.email"/&gt;
      &lt;input type="submit" value="Do something"/&gt;
  &lt;/form&gt;
  </code></pre>
  
  <pre class="lang-js prettyprint-override"><code>$scope.doSomething = function () {
          $http({url: '/api/oauth2/register', method: 'POST', data: $scope.do_obj}
          ).then(function (data, status, headers, config) {
                     $log.info("data = ", data, "status = ", status,
                               "headers = ", headers, "config = ", config);
                 }
          );
  };
  </code></pre>
  
  <p><a href="http://plnkr.co/edit/40nkCR1wpF3wFdBXHfgW?p=preview" rel="nofollow">Plnkr (bootstrap styled)</a></p>