title: angularjs 400 bad request during http post request
body: <p>I'm in the middle of constructing a single page web application, with an Django Rest Framework API backend. I'm having issue sending off registration forms. I think there's a problem with the way the dates are formatted.
  Here's what the controller looks like:</p>
  
  <pre><code>(function () {
  'use strict';
  
  angular
      .module('CityWits')
      .controller('standardController', standardController);
  
  standardController.$inject = ['UserService','$location', '$rootScope', 'FlashService'];
  function standardController(UserService, $location, $rootScope, FlashService) {
      var vm = this;
  
      vm.standard = standard;
  
      function standard() {
          vm.dataLoading = true;
  
          var str = [];
          for(var p in vm.user){
              str.push(encodeURIComponent(p) + "=" + encodeURIComponent(vm.user[p]));
          }
          str = str.join("&amp;");
  
          UserService.CreateStandard(vm.user)
              .then(function (response) {
                  if (response.success) {
                      FlashService.Success('Registration successful', true);
                      $location.path('/sign-in');
                  } else {
                      alert(response.message)
                      vm.dataLoading = false;
                  }
              });
      }
  
      function fixDate(date){
  
  
      }
  }
  </code></pre>
  
  <p>})();</p>
  
  <p>The Post requests:</p>
  
  <pre><code> function CreateStandard(user) {
          console.log(user)
          return $http.post('http://127.0.0.1:8000/api/users/standard', user).then(handleSuccess, handleError('Error creating user'));
      }
  </code></pre>
  
  <p>The json object being sent from the form:</p>
  
  <pre><code>Object
  </code></pre>
  
  <p>date_of_birth
  :
  Fri Aug 06 1993 00:00:00 GMT-0400 (Eastern Daylight Time)
  first_name
  :
  "David"
  gender
  :
  "M"
  last_name
  :
  "Galloway"
  user
  :
  Object
  email
  :
  "dcgallo93@gmail.com"
  password
  :
  "*******"
  <strong>proto</strong>
  :
  Object
  <strong>proto</strong>
  :
  Object</p>