Android Retrofit return status 500 internal server error

前端 未结 3 746
臣服心动
臣服心动 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:41

    Just add the header accept in the request as follow:

    Request request = new Request.Builder()
                    .url(urlString)
                    .header("accept", "application/json")
                    .build();
    

提交回复
热议问题