title: Error OPTIONS net::ERR_CONNECTION_REFUSED
body: <p>I am developing a web application using "jQuery"(front-end) and "Python"(back-end). While making a PUT request to update details in the database, this is the error I get in the console:</p>
  
  <blockquote>
    <p>OPTIONS "REST API URL" net::ERR_CONNECTION_REFUSED</p>
  </blockquote>
  
  <p>My jQuery code is:</p>
  
  <pre><code>$.ajax({ 
      type: "PUT",
      url: "REST API URL",
      headers: {"Content-Type": "application/json", "Authorization": AuthToken},
      data: "details to be updated in database",
      contentType: "application/json; charset=utf-8",
      dataType: "json",
      success: function(data,status) {
        //do something with data
      },
      error: function(data,status) {
        //show error data and status
      }
  )};
  </code></pre>
  
  <p>I read about how HTTP Requests other than <code>GET</code> and <code>POST</code> are first pre-flighted as OPTIONS request and only when it is a genuine request, it gets processed as a <code>PUT/DELETE/PATCH</code> request.<br>
  I saw solutions where it said that it might be a <code>CORS</code> issue, but <code>CORS</code> is <strong>enabled</strong> from the back-end to allow <code>GET/POST/PUT/PATCH/DELETE</code> requests. Further, I am successfully able to make <code>GET</code> and <code>POST</code> requests but no <code>PUT</code> requests are going through.<br>
  I am using "Chrome Dev Tools" and researched about how to fix this error for Chrome by clearing cache and cookies, flushing DNS and re-installing Chrome but none of the solutions have worked so far.<br>
  I am a making the front end UI and am not sure whether this is a client-side error or a server-side error?<br>
  Any help would be appreciated.</p>