title: CORS in python tornado only send option request
body: <p>First of all I've read this question:
  <a href="https://stackoverflow.com/questions/35254742/tornado-server-enable-cors-requests/35259440">Tornado server: enable CORS requests</a><br>
  What I did is:</p>
  
  <pre><code>class BaseHandler(RequestHandler):
      def set_default_headers(self, *args, **kwargs):
          self.set_header("Access-Control-Allow-Origin", "*")
          self.set_header("Access-Control-Allow-Headers", "x-requested-with")
          self.set_header("Access-Control-Allow-Methods", "POST, GET, OPTIONS")
  </code></pre>
  
  <p>And also an option method:</p>
  
  <pre><code>def options(self):
      self.set_status(204)
      self.finish()
  </code></pre>
  
  <p>And in my handler:</p>
  
  <pre><code>class AmirTest(BaseHandler):
      def get(self, *args, **kwargs):
          self.write('You have requested get method!')
  
      def post(self, *args, **kwargs):
          self.write('You have requested post method!')
  
      def put(self, *args, **kwargs):
          self.write('You have requested put method!')
  
      def delete(self, *args, **kwargs):
          self.write('You have requested delete method!')
  </code></pre>
  
  <p>This is how I request:</p>
  
  <pre><code>function del(){
      $.rest.put(
          "http://xxx.xxx.xxx.xxx:7777/amir_test",
          {user: "A",pass: "b"}, 
          function (data) {console.log(data);}
      );
  }
  </code></pre>
  
  <p>The problem is when I made a request this url, in the network tab of inspector there is only an option and no put request. what should I do?</p>
  
  <p><a href="https://ibb.co/cjEq2Q" rel="nofollow noreferrer"><img src="https://ibb.co/cjEq2Q" alt="Loot at the inspect element"></a></p>