code: private void setupHeaders(HttpURLConnection connection) {
          for (Map.Entry<String, Object> entry : getHeaders().entrySet()) {
              connection.setRequestProperty(entry.getKey(), String.valueOf(entry.getValue()));
          }
          connection.setDoOutput(true);
          connection.setDoInput(true);
          connection.setUseCaches(false);
          connection.setAllowUserInteraction(false);
      }
docs: Setups up the header and basic connection information
  
  @param connection - the connection to add headers to