How can I handle empty response body with Retrofit 2?

后端 未结 4 1892
悲&欢浪女
悲&欢浪女 2020-11-30 20:33

Recently I started using Retrofit 2 and I faced an issue with parsing empty response body. I have a server which responds only with http code without any content inside the

4条回答
  •  悲&欢浪女
    2020-11-30 20:59

    If you are using rxjava, use something like :

    @GET("/path/to/get")
    Observable> getMyData(/* your args here */);
    

提交回复
热议问题