title: jQuery and Cross Domain POST Requests
body: <p>I'm developing a jQuery plug-in that will be a connector for some REST API.
  The implementation is straight forward, but the same origin policy is definitely painfull.
  I need to perform mostly POST requests.</p>
  
  <p>I also tried to implement the OPTIONS method and returning (is python, but the meaning should be clear)</p>
  
  <pre><code>def options(self):
    self.response.headers['Access-Control-Allow-Origin'] = self.request.host_url
    self.response.headers['Access-Control-Allow-Methods'] = 'POST, GET, OPTIONS'
    self.response.headers['Access-Control-Allow-Headers'] = 'x-requested-with'
    self.response.headers['Access-Control-Max-Age'] = '1728000'
  </code></pre>
  
  <p>still doesn't work... any idea ?</p>
  
  <p>PS: I have seen that there are other question with a similar topic but i need a specific solution for POST method (GET could be easely implemented by using iframes)</p>
  
  <p>Javascript example:</p>
  
  <pre><code>$.ajax({
      url: options.protocol+'://'+options.host+':'+options.port+'/'+method,
      data: rawData,
      async:false,
      dataType: "json",
      type:"POST",
      success:function(data)
      {
          alert('asd');
          result.data = data;
          alert(data);
      },
      error:function(lol){
          alert('omggg !!!!'+lol);
      }
  
  });
  </code></pre>
  
  <p>EDIT: added javascript code example</p>