{"action":"closed","issue":{"url":"https://api.github.com/repos/square/okhttp/issues/1935","labels_url":"https://api.github.com/repos/square/okhttp/issues/1935/labels{/name}","comments_url":"https://api.github.com/repos/square/okhttp/issues/1935/comments","events_url":"https://api.github.com/repos/square/okhttp/issues/1935/events","html_url":"https://github.com/square/okhttp/issues/1935","id":112233507,"number":1935,"title":"HttpLoggingInterceptor does not log response body when Transfer-Encoding is set to chunked","user":{"login":"austynmahoney","id":1133292,"avatar_url":"https://avatars.githubusercontent.com/u/1133292?v=3","gravatar_id":"","url":"https://api.github.com/users/austynmahoney","html_url":"https://github.com/austynmahoney","followers_url":"https://api.github.com/users/austynmahoney/followers","following_url":"https://api.github.com/users/austynmahoney/following{/other_user}","gists_url":"https://api.github.com/users/austynmahoney/gists{/gist_id}","starred_url":"https://api.github.com/users/austynmahoney/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/austynmahoney/subscriptions","organizations_url":"https://api.github.com/users/austynmahoney/orgs","repos_url":"https://api.github.com/users/austynmahoney/repos","events_url":"https://api.github.com/users/austynmahoney/events{/privacy}","received_events_url":"https://api.github.com/users/austynmahoney/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-19T21:08:24Z","updated_at":"2015-10-19T23:48:59Z","closed_at":"2015-10-19T23:48:59Z","body":"OkHttp 2.6.0-SNAPSHOT\r\n\r\n[`HttpLoggingInterceptor`](https://github.com/square/okhttp/blob/master/okhttp-logging-interceptor/src/main/java/com/squareup/okhttp/logging/HttpLoggingInterceptor.java) is not logging the response body of a `POST` request where the response is sent using `Transfer-Encoding: chunked` instead of setting a `Content-Length`.\r\n\r\nStepping through the code I see that [`responseBody.contentLength()`](https://github.com/square/okhttp/blob/master/okhttp-logging-interceptor/src/main/java/com/squareup/okhttp/logging/HttpLoggingInterceptor.java#L207) `== -1` (which it eventually grabs from `RealResponseBody` using the `Content-Length` header), even though evaluating [`buffer.clone().readString(charset)`](https://github.com/square/okhttp/blob/master/okhttp-logging-interceptor/src/main/java/com/squareup/okhttp/logging/HttpLoggingInterceptor.java#L209) still returns the full response body.\r\n\r\nI'm not sure why the server is chunking a json response, but should the logger still work as intended in this case?"}}