I am using retrofit 2.0 and I am implementing a delete feature in my Android app, however, I cannot make it successfully, can someone give me a suggestion?
I tried both:
@DELETE("books/{id}") void deleteBook(@Path("id") int itemId);
@DELETE("books/{id}") void deleteBook(@Path("id") int bookId, Callback<Response> callback);
I get error java.lang.IllegalArgumentException: Service methods cannot return void. for method LibraryService.deleteBook.
I also gave a try on this:
Response deleteBook(@Path("id") int bookId);
Call<Response> deleteBook(@Path("id") int bookId);
no matter I use okhttp3.Response or retrofit2.Response, I will get the error: '*.Response' is not a valid response body type. Did you mean ResponseBody?
Can someone give me a successful delete example? I googled online but cannot find enough information. Thanks a lot.