Retrofit2 error java.io.EOFException: End of input at line 1 column 1

后端 未结 3 1750
抹茶落季
抹茶落季 2020-12-29 18:00

I called PATCH web service using Retrofit2 but onResponse is not called and the onFailure is called Despite of

3条回答
  •  孤城傲影
    2020-12-29 18:15

    just return void instead, if the body is empty

    @PATCH("alerts/{alert_id}/accept") Call accept_invited_alerts(@Header("X-Api-Token") String api_token, @Path("alert_id") int alert_id);
    

    for retrofit with Rx java you can use something like this

    @PATCH("alerts/{alert_id}/accept") Observable> accept_invited_alerts(@Header("X-Api-Token") String api_token, @Path("alert_id") int alert_id);
    

提交回复
热议问题