title: Route is working from Postman, but it is not working from client
body: <p>I am trying to fix a 400: Bad Request error. I get a 200 success when I make a PUT request from Postman <a href="http://i.stack.imgur.com/2pQwN.png" rel="nofollow">see image</a> . However, when I try the route from the browser, it gives me that 400. </p>
  
  <blockquote>
    <p>angular.js:11881 PUT
    <a href="http://localhost:8000/api/users/addStock/578430b65bd7a5dca37bf2e5" rel="nofollow">http://localhost:8000/api/users/addStock/578430b65bd7a5dca37bf2e5</a> 400
    (Bad Request)</p>
    
    <p>err:  Object {data: Object, status: 400, config: Object, statusText:
    "Bad Request"}</p>
  </blockquote>
  
  <p>stock.html</p>
  
  <pre><code>&lt;form ng-submit='addStock()'&gt;
      &lt;input type="text" ng-model='addObj.symbol' placeholder="symbol" required&gt;
      &lt;button class="btn btn-success"&gt;Add&lt;/button&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>controller.js</p>
  
  <pre><code>app.controller('stockCtrl', function($scope,User){
      $scope.addStock = () =&gt; {
          let userId = '578430b65bd7a5dca37bf2e5';
          User.addStock(userId, $scope.addObj.symbol)
            .then(res =&gt; {
              console.log("res.data: ", res.data);
            })
            .catch(err =&gt; {
              console.log("err: ", err);
            })
      }
  </code></pre>
  
  <p>service.js</p>
  
  <pre><code>app.service('User', function($http) {
      this.addStock = (id, symbol) =&gt; {
        return $http.put(`/api/users/addStock/${id}`, symbol);
      }
  }
  </code></pre>
  
  <p>routes/api/users.js</p>
  
  <pre><code>router.put('/addStock/:userId',(req,res)=&gt;{
  
    User.findById(req.params.userId, (err, user)=&gt;{
      if(err || !user) return res.status(400).send(err || {error: 'user not found'});
  
      let stock = {
        symbol : req.body.symbol
      }
      user.stocks.push(stock);
      user.save((err, savedStock)=&gt;{
        res.status(err ? 400 : 200).send(err || savedStock);
      })
    })
  })
  </code></pre>
  
  <p>If anybody can help me. I will be very greatful. Thank you so much.</p>