title: "No 'Access-Control-Allow-Origin' header" error in Flask POST request [CORS]
body: <p>I'm getting the following CORS error making a POST request to a flask server from an angular app:</p>
  
  <p><code>No 'Access-Control-Allow-Origin' header is present on the requested resource.</code></p>
  
  <p>Flask server:</p>
  
  <pre><code>from flask import Flask, request
  from flask.ext.cors import CORS
  app = Flask(__name__)
  cors = CORS(app)
  
  @app.route('/testPost', methods=['POST'])
  def testPost():
    phone = request.values.get('phone')  
    return phone
  
  if __name__ == '__main__':
    app.run(debug=True)
  </code></pre>
  
  <p>I've tried combinations of different response headers with no luck. The pre-flight OPTIONS request returns 200 ok with the following headers</p>
  
  <p>Response:</p>
  
  <pre><code>HTTP/1.0 200 OK
  Content-Type: text/html; charset=utf-8
  Allow: POST, OPTIONS
  Access-Control-Allow-Origin: http://localhost:7000
  Access-Control-Allow-Headers: accept, content-type
  Access-Control-Allow-Methods: DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT
  Content-Length: 0
  Server: Werkzeug/0.11.3 Python/2.7.11
  Date: Wed, 18 May 2016 00:58:10 GMT
  </code></pre>
  
  <p>Request:</p>
  
  <pre><code>OPTIONS /testPost HTTP/1.1
  Host: localhost:5000
  Connection: keep-alive
  Cache-Control: max-age=0
  Access-Control-Request-Method: POST
  Origin: http://localhost:7000
  Access-Control-Request-Headers: accept, content-type
  Accept: */*
  Referer: http://localhost:7000/
  Accept-Encoding: gzip, deflate, sdch
  Accept-Language: en-US,en;q=0.8
  </code></pre>