Service methods cannot return void. retrofit

前端 未结 4 1691
执念已碎
执念已碎 2020-12-09 01:30

This is my method in Interface. I am calling this function but app crash with this exception:

Caused by: java.lang.IllegalArgumentException: Service m

4条回答
  •  萌比男神i
    2020-12-09 02:07

    You can always do:

    @POST("/endpoint")
    Call postSomething();
    

    EDIT:

    If you are using RxJava, since 1.1.1 you can use Completable class.

提交回复
热议问题