}
@Override
protected HttpResponse invoke(HttpURLConnection connection) throws IOException, InterruptedException {
HttpResponse original = super.invoke(connection);
HttpResponse.Builder<?> response = original.toBuilder();
if (hasPayload(original)) {
// As we need to read the response body to determine if there are errors, but we may need to process the body
// again later in the response parsers if everything is OK, we buffer the body into an InputStream we can reset
InputStream in = null;