title: Nodejs restful API unable to POST
body: <p>I have created a REST API using nodejs which operates on redis, I am able to call the api using get method and it work fine but when I change it to post and try to call it using post. I am getting the error <code>Cannot POST</code>. I am attaching my code below, can you plz let me know what wrong I am doing</p>
  
  <pre><code>app.post('/foobar/:ticketid/:date/:from_time/:to_time/:seats', function(req, res) {
      var id = req.params.ticketid;
      var date = req.params.date;
      var seats = req.params.seats;
      var from_time = req.params.from_time;
      var to_time = req.params.to_time;
      var key = id + date;
      var result = {};
  
      client.exists(key, function(err, reply) {
          if (reply === 1) {
              //console.log("Key Found data from key: ");
              client.get(key, function(err, reply) {
                  var output = JSON.parse(reply);
                  var data = [];
                  output.forEach(function(entry) {
                      var temp = {};
                      temp['from_time'] = entry["from_time"];
                      temp['to_time'] = entry["to_time"];
                      if ((entry["from_time"] == from_time) &amp;&amp; (entry["to_time"] == to_time)) {
  
                          temp['vacancies'] = entry["vacancies"] - seats;
                      } else {
                          temp['vacancies'] = entry['vacancies'];
                      }
                      data = data.concat(temp);
                  });
                  client.set(key, JSON.stringify(data));
  
  
                  result['response'] = 1;
                  result['message'] = 'vacancies successfully updated!';
                  res.json(result);
              });
          } else {
              result['response'] = 0;
              result['message'] = 'Invalid timeslot!';
              res.json(result);
          }
      });
  });
  </code></pre>
  
  <p>I am calling using postman and also Rest easy plugin. 
  In the url I am putting  <code>http://xxx.xxx.xxx.xxx:8081/foobar/</code>
  and in the body I am putting the key value pairs</p>
  
  <p>Code from Postman:</p>
  
  <pre><code>POST /foobar/ HTTP/1.1
  Host: xxx.xxx.xxx.xxx:8081
  Authorization: Basic NDM5OlA5MS1RVDhQLUs4RzktTDU2
  Content-Type: multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW
  Cache-Control: no-cache
  Postman-Token: ab3cb383-62d4-475f-0e59-881a167156eb
  
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="ticketid"
  
  251
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="date"
  
  2016-05-14
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="from_time"
  
  18:00
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="to_time"
  
  21:00
  ------WebKitFormBoundary7MA4YWxkTrZu0gW
  Content-Disposition: form-data; name="seats"
  
  5
  ------WebKitFormBoundary7MA4YWxkTrZu0gW--
  </code></pre>