Skip to content

Latest commit

 

History

History
21 lines (19 loc) · 518 Bytes

README.md

File metadata and controls

21 lines (19 loc) · 518 Bytes

retrofit2

使用

初始化

HttpManager.getInstance().init(new RequestInfo(), mServerUrl);

使用MVP或者MVVM的架构,在P或者VM层调用请求

HttpManager.getInstance().request(new PBAppInfo.Builder().build(), 1001, PBResponse.class, new ApiCallback<PBResponse>() {

    @Override
    public void onSuccess(PBResponse response) {
        super.onSuccess(response);
    }

    @Override
    public void onFailure(int code, String message) {
        super.onFailure(code, message);
    }
});