protected int writeStream(HttpURLConnection conn, byte[] content) throws Exception {
        OutputStream out = null;
        try {
            out = conn.getOutputStream();
            out.write(content);
            return conn.getResponseCode();
        } finally {
            if (out != null) {
                try {
                    out.close();
                } catch (Exception ignored) {
                }
            }
        }
    }