title: $http.post is not a function
body: <p>I am trying to submit a form data to an API endpoint which I created. I have tested it in <strong>PostMan</strong> and the API functions well and I can get the data in successfully. But while connecting that API endpoint to a function in angular js I get the following error.</p>
  
  <p><a href="https://i.stack.imgur.com/f09s7.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f09s7.png" alt="enter image description here"></a></p>
  
  <p><strong>Heres my code:</strong></p>
  
  <pre><code> $scope.saveSession = function() {
  
      $http.post("/session/survey", $scope.session).success(function(data, status) {
           $window.location.href = '/';
  
                  console.log("Sucessfully getting data" + JSON.stringify(data));
      })
    }
  </code></pre>
  
  <p><strong>Note:</strong></p>
  
  <p><code>$scope.session</code> is an object that being populated by using the <code>ng-model</code> tag.
  For example:</p>
  
  <pre><code>&lt;input type="text" ng-model="session.title"&gt;
  </code></pre>
  
  <p><strong>Edit (Controller Code):</strong></p>
  
  <pre><code>// This is our controller for the bio page
  var session = angular.module('session', ['sessionService'])
  
  session.controller('sessionCtrl', function($scope, $http, $window, sessionServices) {
  
  $scope.session = {};
  
  $scope.saveSession = function() {
  
      $scope.session.sessionNo = 1;
      $scope.session.coach = "mmmm";
      $scope.session.modules = "wokr place";
  
      //console.log(user);
      $http.post("/session/survey", $scope.session).success(function(data, status) {
           $window.location.href = '/';
                  console.log("Sucessfully getting added bio" + JSON.stringify(data));
      })
      };
  
   });
  </code></pre>