Created
December 16, 2018 00:11
-
-
Save NoNews/d1e9579c658fe4f61a3420c0c571d4a7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File file = new File(selectedImage.getPath()); | |
RequestBody body = RequestBody.create(MediaType.parse("image/*"), file); | |
restApi.imageEndpoint.upload(user.getToken(), body) | |
.observeOn(AndroidSchedulers.mainThread()) | |
.subscribeOn(Schedulers.io()) | |
.subscribe(this::successGetImageDTO, this::errorGetImageDto); | |
@Multipart | |
@POST("user/avatarUpload") | |
Observable<StatusResponse<UserDTO>> uploadAvatar(@Part("file\"; filename=\"cover.png\" ") RequestBody file); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment