title: $http.put request changing into OPTIONS request in AngularJS 1.3.15
body: <p>I'm new to the AngularJS. I'm using AngularJS 1.3.15 version. When I try to call an api with PUT method, It's generating OPTIONS request. I don't know where I'm doing mistake. I tried so many methods which is suggested in Stockoverflow, but still I'm not getting anything. Please help me to resolve this issue. below are my Controller, Models, html files and Chrome developer tool network activity screenshot.</p>
  
  <p>Controller file users.js</p>
  
  <pre><code>'use strict';
  mmlApp_users.config(['$routeProvider', function($routeProvider){
    $routeProvider
      .when('/users/update/:userId', {
        templateUrl: 'views/users/update.html',
        controller: 'update',
        resolve: {
          user: function(users, $route){
            var userId = $route.current.params.userId
            return users.getUser(userId);
          }
        }
      })
      .otherwise({
        redirectTo: '/users/index'
      });
  }]);
  </code></pre>
  
  <p>Model file - users.js</p>
  
  <pre><code>'use strict';
  mmlApp_users.factory('users', ['$http', '$location', '$route', function($http, $location, $route){
    var obj = {}; 
  
    obj.getUser = function(userId){
      return $http.get(serviceBase + 'users/view/'+userId);
    };
  
    obj.updateUser = function(user){
      var config = {
            headers: {
              'Content-Type': 'application/json'
            }
          };
      var userParams = {
          first_name: user.first_name, 
          last_name: user.last_name, 
          email: user.email, 
          password: user.password,
          address: user.address,
          state: user.state,
          city: user.city,
          zip_code: user.zip_code
        };
      $http.put(serviceBase + 'users/update/'+user.id+'?access-token=8e0bb9b3-b35f-4d30-943d-6028c0b85c13', userParams, config)
            .then(successHandler).catch(errorHandler);
  
      function successHandler(){
        $location.path('/users/index');
      }
      function errorHandler(){
        alert('Oops! Somthing went wrong.');
        //$location.path('/users/create');
      }
    };
  
    return obj;
  }]);
  </code></pre>
  
  <p>Views - update.html</p>
  
  <pre><code>&lt;div&gt;
    &lt;h1&gt;{{title}}&lt;/h1&gt;
    &lt;p&gt;{{ message}}&lt;/p&gt;
    &lt;form role="form" name="myForm"&gt;
      &lt;div class="row"&gt;
        &lt;div class= "form-group col-md-6" ng-class="{error: myForm.first_name.$invalid}"&gt;
          &lt;label&gt; First Name: &lt;/label&gt;
          &lt;div&gt;
            &lt;input name="first_name" ng-model="user.first_name" type= "text" class= "form-control" placeholder="First Name" required/&gt;
            &lt;span ng-show="myForm.first_name.$dirty &amp;&amp; myForm.first_name.$invalid" class="help-inline"&gt;First Name Required&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;
        &lt;div class= "form-group col-md-6" ng-class="{error: myForm.last_name.$invalid}"&gt;
          &lt;label&gt; Last Name: &lt;/label&gt;
          &lt;div&gt;
            &lt;input name="last_name" ng-model="user.last_name" type= "text" class= "form-control" placeholder="Last Name" required/&gt;
            &lt;span ng-show="myForm.last_name.$dirty &amp;&amp; myForm.last_name.$invalid" class="help-inline"&gt;Last Name Required&lt;/span&gt;
          &lt;/div&gt;
        &lt;/div&gt;
      &lt;/div&gt;
      ....
      ....
      ....
  
      &lt;a href="#/users/index" class="btn btn-default"&gt;Cancel&lt;/a&gt;
      &lt;button ng-click="updateUser(user);" ng-disabled="myForm.$invalid" type="submit" class="btn btn-default"&gt;Submit&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>In chrome developer tool network activity screenshot - 
  <a href="https://i.stack.imgur.com/r2Azc.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/r2Azc.png" alt="enter image description here"></a></p>