【发布时间】:2017-12-04 08:26:23
【问题描述】:
这是我的 angularJs 请求:
url = root + "/products";
$http.post(url, params)
.then(function(response) {
console.log('Successfull...');
});
这是我在 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")
这是我的选择方法:
def options(self, *args, **kwargs):
self.set_status(204)
self.finish()
为什么 angularJS 只发送一个选项请求而没有发送请求?
【问题讨论】:
-
控制台有错误吗?
标签: python angularjs httprequest