code: protected HttpURLConnection getConnection() {
          try {
              HttpURLConnection connection;
              if (proxy != null) {
                  connection = (HttpURLConnection) sentryUrl.openConnection(proxy);
              } else {
                  connection = (HttpURLConnection) sentryUrl.openConnection();
              }
  
              if (bypassSecurity && connection instanceof HttpsURLConnection) {
                  ((HttpsURLConnection) connection).setHostnameVerifier(NAIVE_VERIFIER);
              }
              connection.setRequestMethod("POST");
              connection.setDoOutput(true);
              connection.setConnectTimeout(connectionTimeout);
              connection.setReadTimeout(readTimeout);
              connection.setRequestProperty(USER_AGENT, SentryEnvironment.getSentryName());
              connection.setRequestProperty(SENTRY_AUTH, getAuthHeader());
  
              if (marshaller.getContentType() != null) {
                  connection.setRequestProperty("Content-Type", marshaller.getContentType());
              }
  
              if (marshaller.getContentEncoding() != null) {
                  connection.setRequestProperty("Content-Encoding", marshaller.getContentEncoding());
              }
  
              return connection;
          } catch (IOException e) {
              throw new IllegalStateException("Couldn't set up a connection to the Sentry server.", e);
          }
      }
docs: Opens a connection to the Sentry API allowing to send new events.
  
  @return an HTTP connection to Sentry.