res.headerlist.append(('Access-Control-Allow-Origin', '*'))
res.headerlist.append(('Access-Control-Allow-Methods', 'GET, POST'))
res.headerlist.append(('Access-Control-Max-Age', '3600'))
res.headerlist.append(('Access-Control-Allow-Headers', 'Access-Control-Allow-Origin, Access-Control-Allow-Methods, Access-Control-Max-Age, X-Auth-Token, Content-Type, Accept'))
res.headerlist.append(('Access-Control-Allow-Origin', 'http://10.111.121.26:8080'))
def process_request(self, req):
if (req.headers.get('X-Auth-Token') != 'open-sesame') and (req.method != 'OPTIONS'):
return exc.HTTPForbidden()
data_param = {"timeType":"LAST_7_DAYS", "hostType":"ALL_HOSTS"}
$.ajax({
url:"http://172.16.17.11:41128/dpi/webApp/eventRetrieve",
type: "POST",
data:JSON.stringify(data_param),
headers:{
"X-Auth-Token":"open-sesame",
"Content-Type":"application/json"
},
contentType: 'text/html; charset=UTF-8',
dataType: "json",
success: function(data) {
alert(data); // Object
},
error: function(XMLHttpRequest, textStatus, errorThrown) {
alert(XMLHttpRequest.status);
alert(XMLHttpRequest.readyState);
alert(textStatus);
},
complete: function(XMLHttpRequest, textStatus) {
}
});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有