docs: @Override
  	public Object invoke(String methodName, Object argument, Type returnType, Map<String, String> extraHeaders) throws Throwable {
  		HttpURLConnection connection = prepareConnection(extraHeaders);
  		try {
  			if (this.gzipRequests) {
  				connection.setRequestProperty(CONTENT_ENCODING, GZIP);
  				ByteArrayOutputStream baos = new ByteArrayOutputStream();
  				try (GZIPOutputStream gos = new GZIPOutputStream(baos)) {
  					super.invoke(methodName, argument, gos);
  				}
  				connection.setFixedLengthStreamingMode(baos.size());
  				connection.connect();
  				connection.getOutputStream().write(baos.toByteArray());
  			} else {
  				connection.connect();
  				try (OutputStream send = connection.getOutputStream()) {
  					super.invoke(methodName, argument, send);
  				}
  			}
  			
  			final boolean useGzip = useGzip(connection);
  			// read and return value
  			try {
  				try (InputStream answer = getStream(connection.getInputStream(), useGzip)) {
  					return super.readResponse(returnType, answer);
  				}
  			} catch (JsonMappingException e) {
  				// JsonMappingException inherits from IOException
  				throw e;
  			} catch (IOException e) {
  				if (connection.getErrorStream() == null) {
  					throw new HttpException("Caught error with no response body.", e);
  				}
  
  				try (InputStream answer = getStream(connection.getErrorStream(), useGzip)) {
  					return super.readResponse(returnType, answer);
  				} catch (IOException ef) {
  					throw new HttpException(readErrorString(connection), ef);
  				}
  			}
  		} finally {
  			connection.disconnect();
  		}
  		
  	}