def post(self):
    self.response.headers.add_header('Access-Control-Allow-Origin', '*')
self.response.headers['Content-Type'] = 'application/json'

def options(self):
    self.response.headers['Access-Control-Allow-Origin'] = '*'
self.response.headers['Access-Control-Allow-Headers'
    ] = """Origin, X-Requested-With, Content-Type, Accept"""
self.response.headers['Access-Control-Allow-Methods'
    ] = 'POST, GET, PUT, DELETE'
CORS - Using AJAX to post on a Python (webapp2) web service