class webService(webapp2.RequestHandler):

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

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"""
CORS — использование AJAX для публикации в веб-службе Python (webapp2)