This is my angularJs request:
url = root + "/products";
$http.post(url, params)
.then(function(response) {
console.log('Successfull...');
});
This is my server side headers in python tornado:
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, PUT, DELETE")
And this is my option method:
def options(self, *args, **kwargs):
self.set_status(204)
self.finish()
Why angularJS sends only an option request and no post request?