Open huanyuan opened 6 years ago
我使用的代码
public void getCityBeanHttp() { HashMap parameters = new HashMap<>(); new Novate.Builder(Application.getApplication()) .baseUrl(ApiConstants.ENURL) .build() .post(ApiConstants.ENURL_PATH, parameters, new BaseSubscriber() { @Override public void onError(Throwable e) { LogTools.d("onError()===: " + e.getMessage()); } @Override public void onNext(ResponseBody responseBody) { try { LogTools.d("CityBean onNext()===: " + new String(responseBody.bytes())); } catch (IOException e) { e.printStackTrace(); } } }); }
@huanyuan 谢谢提出问题
@huanyuan 使用RxPost
我使用的代码
public void getCityBeanHttp() { HashMap parameters = new HashMap<>(); new Novate.Builder(Application.getApplication()) .baseUrl(ApiConstants.ENURL) .build() .post(ApiConstants.ENURL_PATH, parameters, new BaseSubscriber() {
@Override
public void onError(Throwable e) {
LogTools.d("onError()===: " + e.getMessage());
}
@Override
public void onNext(ResponseBody responseBody) {
try {
LogTools.d("CityBean onNext()===: " + new String(responseBody.bytes()));
} catch (IOException e) {
e.printStackTrace();
}
}
});
}