I want to ask how to work correctly with the PUT method in Retrofit2 , I wrote the code, but I am not sure that it is correct and I would like to know how to correctly rewrite this code using RxJava .
@PUT("{username}") Call<Void> updateUser(@Path("username") String username,@Body User user); And application:
private void updateUserInfo() { User user = new User("iryna", "Alala", "alala@gmail.com", "some properties" ); Call<Void> deleteRequest = App.service.updateUser("bala", user); deleteRequest.enqueue(new Callback<Void>() { @Override public void onResponse(Call<Void> call, Response<Void> response) { // use response.code, response.headers, etc. } @Override public void onFailure(Call<Void> call, Throwable t) { // handle failure } }); }