OkHttp: avoid leaked connection warning
By upgrading to OkHttp 3.7, Eclipse started warning me of potential resource leaks. I found my problem to be in this method I wrote: public static Response getResponse(HttpUrl url, OkHttpClient client) throws IOException { Builder request = new Request.Builder().url(url); Response response = client.newCall(request.build()).execute(); if (!response.isSuccessful()) { boolean repeatRequest = handleHttpError(response); if (repeatRequest) return getResponse(url, client, … Read more