I see; thanks
2017-01-18 18:16 GMT+08:00 雨日听风 <[email protected]>:
> done! Thank you!
>
> HttpURLConnection conn = (HttpURLConnection)url.openConnection();
> conn.setDoOutput(true);
> conn.setRequestMethod("DELETE");
> //add this setting
> conn.setRequestProperty("Authorization", "************");
>
>
> ------------------ 原始邮件 ------------------
> *发件人:* "ShaoFeng Shi";<[email protected]>;
> *发送时间:* 2017年1月18日(星期三) 晚上6:00
> *收件人:* "user"<[email protected]>;
> *主题:* Re: why cant not delete a segment by api , please
>
> is there any error in kylin.log?
>
> 2017-01-18 15:36 GMT+08:00 雨日听风 <[email protected]>:
>
>> String deleteUrl = "http://192.168.35.2:7070/kylin/api/cubes
>> /F_CUBE/segs/20170113000000_20170114000000";
>> Map<String,Object> map = new HashMap<String,Object>();
>> map.put("username", "ADMIN");
>> map.put("password", "KYLIN");
>> //still not work as
>> //map.put("Authorization", "Basic QURNSU46S1lMSU4=");
>> doDelete(deleteUrl,map);
>> _________
>> public static void doDelete(String urlStr,Map<String,Object> paramMap)
>> throws Exception{
>> String paramStr = prepareParam(paramMap);
>> if(paramStr == null || paramStr.trim().length()<1){
>>
>> }else{
>> urlStr +="?"+paramStr;
>> }
>> System.out.println(urlStr);
>> URL url = new URL(urlStr);
>> HttpURLConnection conn = (HttpURLConnection)url.openConnection();
>> conn.setDoOutput(true);
>> conn.setRequestMethod("DELETE");
>> if(conn.getResponseCode() ==200){
>> System.out.println("成功");
>> }else{
>> System.out.println(conn.getResponseCode());// always print
>> 505 or 401
>> }
>> }
>>
>>
>>
>
>
>
> --
> Best regards,
>
> Shaofeng Shi 史少锋
>
>
--
Best regards,
Shaofeng Shi 史少锋