If I understand it correctly Retrofit does not allow using Call without types i.e.:
@DELETE(PATH_COLLECTION_CARD)
Call deleteCard(@Path("id") String collectionId, @Path("card") String cardId);
This results in: Caused by: java.lang.IllegalArgumentException: Call return type must be parameterized as Call
The rationale for this being "All HTTP calls have a response therefore we force you to acknowledge it in your method signature." according to @JakeWharton in this issue.
I'm encountering APIs that returns an empty body but I would still like to use Call for the other features it provides ( execute vs enqueue etc..). My workaround was to declare an EmptyData object like so:
@DELETE(PATH_COLLECTION_CARD)
Call<EmptyData> deleteCard(@Path("id") String collectionId, @Path("card") String cardId);
However, because the body is completely empty Jackson now throws this exception:
com.fasterxml.jackson.databind.JsonMappingException: No content to map due to end-of-input
Wouldn't it make sense to allow Calls without types in this case?
Did you try --
@DELETE(PATH_COLLECTION_CARD)
Call<Void> deleteCard(@Path("id") String collectionId, @Path("card") String cardId);
Top of the beta2 change list -- https://github.com/square/retrofit/blob/master/CHANGELOG.md
That was exactly what I was looking for. My google-fu failed me in this instance. Thanks. :)
Most helpful comment
Did you try --
Top of the beta2 change list -- https://github.com/square/retrofit/blob/master/CHANGELOG.md