Android Retrofit return status 500 internal server error

前端 未结 3 740
臣服心动
臣服心动 2021-01-19 04:05

I am using Retrofit like this to get all the books and delete all the books.

 @GET(\"/books\")
    BookListResponse getAllBooks();
    @DELETE(\"/clean\")
           


        
3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-19 04:28

    Update
    In Retrofit 2.1 the request builder has changed so you have to specify header in the retrofit interface methods

    @Headers("Accept: application/json") @GET("products") Call getAllProducts();

提交回复
热议问题