retrofit icon indicating copy to clipboard operation
retrofit copied to clipboard

'okhttp3.Response' is not a valid response body type.

Open shaburov opened this issue 3 years ago • 0 comments

Why can't I get a raw response using retrofit?

    @GET("/api/service/live")
    Response liveCheck();

I implemented retrofit2.CallAdapter.Factory and a converter specifically for getting a raw response, however I got an exception.

IllegalArgumentException: 'okhttp3.Response' is not a valid response body type. Did you mean ResponseBody?
    for method JavaTypeAdapterFactoryClient.returnRawResponseType

What is the reason for this limitation? And what problem does this exception solve? image

shaburov avatar Feb 24 '22 10:02 shaburov