Skip to content

可切换的网络框架,okhttp,retrofit,可加入其它的网络框架实现

Notifications You must be signed in to change notification settings

isqing/HttpUtilLibrary

Repository files navigation

HttpUtilLibrary

可切换的网络框架,okhttp,retrofit,可加入其它的网络框架实现 库中有一个定义的post方法,可根据产品需求自行添加方法 as引用 implementation project(path: ':httputillibray')

Application中初始化: 1.retrofit HttpHelper.init(new RetrofitProcessor(url)); 2.okhttp HttpHelper.init(new OkhttpProcessor();

调用示例: Map<String ,Object> map=new HashMap<>();

    HttpHelper.instance().post(url, map, new HttpCallBack<MyResponse>() {
        @Override
        public void onSuccess(MyResponse result) {
            Log.i(TAG, "onSuccess: "+result.getResponse());
            Toast.makeText(getApplicationContext(),result.getResponse()+"",Toast.LENGTH_LONG).show();
        }
    });

About

可切换的网络框架,okhttp,retrofit,可加入其它的网络框架实现

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages