I need perform a DELETE request using Retrofit. So, my code snippet of the interface looks like this:
@DELETE(\"/api/item/{id}\")
void deleteItem(@Path(\"id\") i
You have to add Callback as last argument in request method if you want to have void method. You can useCallback
.
You have to change this:
@DELETE("/api/item/{id}")
void deleteItem(@Path("id") int itemId);
to :
@DELETE("/api/item/{id}")
void deleteItem(@Path("id") int itemId, Callback callback);
Or you can return just Response
@DELETE("/api/item/{id}")
Response deleteItem(@Path("id") int itemId);