it returns "Request failed:", test code as follow:


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
<link rel="stylesheet" type="text/css" 
href="jquery-easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="jquery-easyui/demo/demo.css">
<script type="text/javascript" src="jquery-easyui/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery.base64.js"></script>
</head>
<script>
var authorizationCode = $.base64('encode', 'ADMIN' + ":" + 'KYLIN');
 
$.ajaxSetup({
    headers: { 
'Authorization': "Basic " + authorizationCode, 
'Content-Type': 'application/json;charset=utf-8' 
   }
});    
function query()
{

 var request = $.ajax({
       url: "http://hadoop-tapp12:7070/kylin/api/query";,
       type: "POST",
       data: '{"sql":"select count(*) from 
kylin_cal_dt;","offset":0,"limit":50000,"partial":true,"project":"learn_kylin"}',
       dataType: "json"
    });
    request.done(function( msg ) {
       alert(msg);
    }); 
    request.fail(function( jqXHR, textStatus ) {
       alert( "Request failed: " + textStatus );
  });
}
</script>
<body style="padding:2px; margin:2px;">
<div><input type="button" onClick="query()" value="query" /></div>
</body>
</html>



梁猛 
中国移动广东公司 网管维护中心 网管支撑室 
电话:13802880779
邮箱: [email protected][email protected]
地址:广东省广州市珠江新城珠江西路11号 广东全球通大厦北3楼 
邮编:510623 

Reply via email to