RequestBody fileBody = RequestBody.create(MediaType.parse("application/octet-stream"),
new File("/mnt/sdcard/Pictures/testhead.png"));
RequestBody requestBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addFormDataPart("file", "testhead.png", fileBody)
.addFormDataPart("address", "test address")
.build();
HttpUtils.getHttpService().updateMyInfo(requestBody)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(new ProgressSubscriber<Object>(mContext, mView) {
@Override
public void onSuccess(Object o) {
mView.onAddCheckSuccess();
}
});