class InfluxDbHttpSender extends InfluxDbBaseSender {

    @Override
    protected int writeData(byte[] line) throws Exception {
        final HttpURLConnection con = (HttpURLConnection) url.openConnection();
        con.setRequestMethod("POST");
        if (authStringEncoded != null && !authStringEncoded.isEmpty()) {
            con.setRequestProperty("Authorization", "Basic " + authStringEncoded);
        }
        con.setDoOutput(true);
        con.setConnectTimeout(connectTimeout);
        con.setReadTimeout(readTimeout);

        OutputStream out = con.getOutputStream();
        try {
            out.write(line);
            out.flush();
        } finally {
            out.close();
        }

        int responseCode = con.getResponseCode();

        // Check if non 2XX response code.
        if (responseCode / 100 != 2) {
            throw new IOException(
                "Server returned HTTP response code: " + responseCode + " for URL: " + url + " with content :'"
                    + con.getResponseMessage() + "'");
        }
        return responseCode;
    }

    public  InfluxDbHttpSender(
        final String protocol, final String hostname, final int port, final String database, final String authString,
        final TimeUnit timePrecision, final int connectTimeout, final int readTimeout, final String measurementPrefix);
    @Deprecated public  InfluxDbHttpSender(
        final String protocol, final String hostname, final int port, final String database, final String authString,
        final TimeUnit timePrecision);

}