title: Passing value from angular to webapi put method
body: <p>I am trying to pass id value from angular code to asp.net web api. I tried couple of ways but still unable to pass the value. What may be the code issue?</p>
  
  <p>Angular Service code</p>
  
  <pre><code>angular.module('myServiceApp')
  .factory('mySvc', ['$http', function ($http) {
      return {
          startJob: function (id) {
              return $http.put('/api/Job/Put/' + id);
          }
      };
  }]);
  </code></pre>
  
  <p>HTML Code</p>
  
  <pre><code>&lt;div ng-click="initiateJob(id)"&gt;
  Start Now
  &lt;/div&gt;
  </code></pre>
  
  <p>Angular Function</p>
  
  <pre><code>$scope.initiateJob = function (id) {
      mySvc.startJob(id)
           .success(function () {
               alert('started successfully');
           }).error(function (err) {
               $scope.error = err;                
           });
  }
  </code></pre>
  
  <p>webapi code</p>
  
  <pre><code>public HttpResponseMessage Put(int id)
  {
      HttpResponseMessage response = null;           
      return response;
  }
  </code></pre>