title: How perform PATCH request from html form using NodeJS?
body: <p>This was my attempt to perform a patch request on an HTML form from the frontend to MongoDB database via NodeJS API.</p>
  <p>This is a Nodejs API structure</p>
  <pre class="lang-js prettyprint-override"><code>app.route(&quot;/requests/:rollno&quot;)
    .get(function(req, res) {
  // get method to find a query
    })
    .patch(function(req, res) {
      Request.update({
          rollno: req.params.rollno
        }, {
          $set:req.body
        },
        function(err) {
          if (!err) {
            res.send(&quot;Successfully updated requests&quot;);
          }else{
            res.send(err);
          }
        }
      );
    });
    
  </code></pre>
  <p>On the frontend side of the form</p>
  <pre><code>&lt;%- include('partials/header') %&gt;
  &lt;h1&gt;Recent requests&lt;/h1&gt;
  &lt;% for(let i = 0; i &lt; posts.length; i++) { %&gt;
  &lt;article&gt;
      &lt;form action=&quot;/requests/21&quot; method=&quot;PATCH&quot;&gt;
        &lt;input type=&quot;text&quot; name=&quot;status[0]&quot;&gt;
        &lt;div id=&quot;participant&quot;&gt;&lt;/div&gt;
        &lt;br&gt;
        &lt;button type=&quot;button&quot; onclick=&quot;addParticipant()&quot;&gt;Add&lt;/button&gt;
        &lt;button type=&quot;button&quot; onclick=&quot;delParticipant()&quot;&gt;Remove&lt;/button&gt;
        &lt;div class=&quot;btn-block&quot;&gt;
          &lt;button type=&quot;submit&quot; href=&quot;/success&quot;&gt;Submit Request&lt;/button&gt;
        &lt;/div&gt;
      &lt;/form&gt;
  &lt;/article&gt;
  &lt;% } %&gt;
  
  </code></pre>
  <p>The form is not actually updating the information on the actual server. But with the postman, the data is getting updated.What's the best resolution for the same or is there any alternate method for the same ?</p>