codecamp

custom()介绍

当以上提供的现成方法都不能满足您的话,说明您是在太厉害了(啊啊啊)。那么这个方法就是完全给你自由,可以自定义数据处理器。

使用方式如下:

Object custom = response.custom(new DataHandler<Object>() {
    @Override
    public Object handle(Response response) throws IOException {
        return null;
    }
});

关于DataHandler请继续往下看,后面会与介绍的哦。

asFile()和asStream()介绍
HTTPS简介
温馨提示
下载编程狮App,免费阅读超1000+编程语言教程
取消
确定
目录

easy-okhttp 总结

关闭

MIP.setData({ 'pageTheme' : getCookie('pageTheme') || {'day':true, 'night':false}, 'pageFontSize' : getCookie('pageFontSize') || 20 }); MIP.watch('pageTheme', function(newValue){ setCookie('pageTheme', JSON.stringify(newValue)) }); MIP.watch('pageFontSize', function(newValue){ setCookie('pageFontSize', newValue) }); function setCookie(name, value){ var days = 1; var exp = new Date(); exp.setTime(exp.getTime() + days*24*60*60*1000); document.cookie = name + '=' + value + ';expires=' + exp.toUTCString(); } function getCookie(name){ var reg = new RegExp('(^| )' + name + '=([^;]*)(;|$)'); return document.cookie.match(reg) ? JSON.parse(document.cookie.match(reg)[2]) : null; }