使用DELETE调用删除用户时获取JsonMalformedException

时间:2018-07-16 13:04:48

标签: android rx-java retrofit2

@DELETE("users?")

Observable<APIResponseModal> deleteUser(

        @Query("userID") int userID
);


public void deleteUser(int userID) {

    Config config = new Config();
    Retrofit rfDatabase = config.databaseServer();
    api_database = rfDatabase.create(API_Database.class);
    Observable<APIResponseModal> deleteuser = api_database.deleteUser(userID);
    deleteuser.subscribeOn(Schedulers.newThread())
            .observeOn(AndroidSchedulers.mainThread())
            .subscribe(new Subscriber<APIResponseModal>() {
                @Override
                public void onNext(APIResponseModal apiResponseModal) {
                    apiResponseModal.getResponseCode();
                    apiResponseModal.getResponseMessage();
                }
                @Override
                public void onCompleted() {
                    Toast.makeText(mainActivity, "User Deleted", Toast.LENGTH_SHORT).show();
                }
                @Override
                public void onError(Throwable e) {
                }

            });

获取JsonMalformedException,有人可以帮我解决这个问题吗?

0 个答案:

没有答案