/* Get the URL of the given connection
966940
private String getWebSocketURL(HttpRequest req) {
        String protocol = Constants.WS_SCHEME;
        if (secureConnection) {
            protocol = Constants.WSS_SCHEME;
        }
        return protocol + "://" + req.headers().get("Host") + req.uri();
    }
734126
function computeURL() {
          var url = $(input).data("settings").url;
          if(typeof $(input).data("settings").url == 'function') {
              url = $(input).data("settings").url.call($(input).data("settings"));
          }
          return url;
      }
687524
public URLConnection get( Object key )
    {
        synchronized( this ) // ensure no ConcurrentModificationException can occur.
        {
            Entry entry = m_hardStore.get( key );
            if( entry == null )
            {
                return null;
            }
            return entry.m_connection;
        }
    }
460160
function(u){
      var urlObj = url.parse(u)
      return urlObj.protocol + "//" + urlObj.hostname + urlObj.pathname 
    }
178663
function getUrl (file) {

            if (!that.ignore(file)) {
                file = that.map(file);
                file = utils.normalize(file);
                return file;
            }
        }
696431
public String getURL()
  {
    int port = getPort();

    return (getScheme() + "://" + getHost() + 
            (port == 80 ? "" : ":" + getPort()) +
            getPath() +
            (_query == null ? "" : "?" + _query));
  }
156870
def get_connection(self, name):
        
        name = quote(name, '')
        path = Client.urls['connections_by_name'] % name
        conn = self._call(path, 'GET')
        return conn
918843
public Reader getUrl(String prefix, String postfix)
      throws MtasParserException {
    String url = getString();
    if ((url != null) && !url.equals("")) {
      if (prefix != null) {
        url = prefix + url;
      }
      if (postfix != null) {
        url = url + postfix;
      }
      if (url.startsWith("http://") || url.startsWith("https://")) {
        BufferedReader in = null;
        try {
          URLConnection connection = new URL(url).openConnection();
          connection.setRequestProperty("Accept-Encoding", "gzip");
          connection.setReadTimeout(10000);
          if (connection.getHeaderField("Content-Encoding") != null
              && connection.getHeaderField("Content-Encoding").equals("gzip")) {
            in = new BufferedReader(new InputStreamReader(
                new GZIPInputStream(connection.getInputStream()),
                StandardCharsets.UTF_8));
          } else {
            in = new BufferedReader(new InputStreamReader(
                connection.getInputStream(), StandardCharsets.UTF_8));
          }
          return in;
        } catch (IOException ex) {
          log.debug(ex);
          throw new MtasParserException("couldn't get " + url);
        }
      } else {
        throw new MtasParserException("no valid url: " + url);
      }
    } else {
      throw new MtasParserException("no valid url: " + url);
    }
  }
811592
function getDomainFromURL(url) {
  if (url) {
    let domain;
    // find & remove protocol (http, ftp, etc.) and get domain
    if (url.indexOf('://') > -1) {
      domain = url.split('/')[2];
    } else {
      domain = url.split('/');
    }

    // find & remove port number
    domain = domain.split(':');

    return domain;
  }
  return null;
}
1371121
async function getConnection(url, opts = {}) {

    const dbName = opts.databaseName;
    if (!dbName || dbName === '')
        throw boom.badImplementation('jollof-data-arangodb: databaseName config is required', { url, opts })

    const key = url + dbName;

    //Get connection
    let connection;
    if (connPool[key]) {
        connection = connPool[key];
    } else {
        connection = new Database(url)
        connPool[key] = connection;
    }

    //Now ensure database exists
    const dbNames = await connection.listDatabases();
    if (dbNames.indexOf(dbName) > -1) {
        //our db exists. use it.
        connection.useDatabase(dbName)
    } else {
        //our db does not exist. Attempting to create it
        await connection.createDatabase(dbName, [{ username: opts.username, passw: opts.password }])
        connection.useDatabase(dbName)
    }

    return connection;
}
1106654
public static String getHostFromURL(String url) {
		URL u = toURL(url);
		String host = (u == null) ? "" : u.getHost();
		return host;
	}
1034108
def get_url(path, host, port, method="http"):
    
    return urlunsplit(
        (method, "%s:%s" % (host, port), path, "", "")
    )
676086
def get(url, params = {})
      params = params.inject({}){|memo,(k,v)| memo[k.to_s] = v; memo}
      preform(url, :get, params: params) do
        return connection.get(url, params)
      end
    end
710476
@Override
    public ConnectionLink getConnectionLink(VirtualConnection vc) {
        HttpDispatcherLink link = (HttpDispatcherLink) vc.getStateMap().get(HttpDispatcherLink.LINK_ID);
        if (null == link) {
            link = new HttpDispatcherLink();
            link.init(vc, this);
        }
        return link;
    }
720658
function getUrlDelay(url) {
    var delay;
    if (options.url && !options.url.test(url)) {
      delay = 0;
    }

    return delay;
  }
415975
private HttpURLConnection obtainConnection(URL url) throws DownloadFailedException {
        HttpURLConnection conn = null;
        try {
            LOGGER.debug("Attempting retrieval of {}", url.toString());
            conn = connFactory.createHttpURLConnection(url, this.usesProxy);
            conn.setRequestProperty("Accept-Encoding", "gzip, deflate");
            conn.connect();
            int status = conn.getResponseCode();
            int redirectCount = 0;
            // TODO - should this get replaced by using the conn.setInstanceFollowRedirects(true);
            while ((status == HttpURLConnection.HTTP_MOVED_TEMP
                    || status == HttpURLConnection.HTTP_MOVED_PERM
                    || status == HttpURLConnection.HTTP_SEE_OTHER)
                    && MAX_REDIRECT_ATTEMPTS > redirectCount++) {
                final String location = conn.getHeaderField("Location");
                try {
                    conn.disconnect();
                } finally {
                    conn = null;
                }
                LOGGER.debug("Download is being redirected from {} to {}", url.toString(), location);
                conn = connFactory.createHttpURLConnection(new URL(location), this.usesProxy);
                conn.setRequestProperty("Accept-Encoding", "gzip, deflate");
                conn.connect();
                status = conn.getResponseCode();
            }
            if (status != 200) {
                try {
                    conn.disconnect();
                } finally {
                    conn = null;
                }
                final String msg = format("Error retrieving %s; received response code %s.", url.toString(), status);
                LOGGER.error(msg);
                throw new DownloadFailedException(msg);
            }
        } catch (IOException ex) {
            try {
                if (conn != null) {
                    conn.disconnect();
                }
            } finally {
                conn = null;
            }
            if ("Connection reset".equalsIgnoreCase(ex.getMessage())) {
                final String msg = format("TLS Connection Reset%nPlease see "
                        + "http://jeremylong.github.io/DependencyCheck/data/tlsfailure.html "
                        + "for more information regarding how to resolve the issue.");
                LOGGER.error(msg);
                throw new DownloadFailedException(msg, ex);
            }
            final String msg = format("Error downloading file %s; unable to connect.", url.toString());
            throw new DownloadFailedException(msg, ex);
        }
        return conn;
    }
406913
function getPath(url) {

		// Format the string if it needs it
		url = url.replace(/\@\{([a-z\_\-]+)(\|.*?)?\}/gi, function(m, key, defaults) {
			var val = defaults ? defaults.replace(/^\|/, '') : '';
			if (key in p.query) {
				val = p.query[key];
				delete p.query[key];
			}
			else if (p.data && key in p.data) {
				val = p.data[key];
				delete p.data[key];
			}
			else if (!defaults) {
				promise.reject(error('missing_attribute', 'The attribute ' + key + ' is missing from the request'));
			}

			return val;
		});

		// Add base
		if (!url.match(/^https?:\/\//)) {
			url = o.base + url;
		}

		// Define the request URL
		p.url = url;

		// Make the HTTP request with the curated request object
		// CALLBACK HANDLER
		// @ response object
		// @ statusCode integer if available
		utils.request(p, function(r, headers) {

			// Is this a raw response?
			if (!p.formatResponse) {
				// Bad request? error statusCode or otherwise contains an error response vis JSONP?
				if (typeof headers === 'object' ? (headers.statusCode >= 400) : (typeof r === 'object' && 'error' in r)) {
					promise.reject(r);
				}
				else {
					promise.fulfill(r);
				}

				return;
			}

			// Should this be an object
			if (r === true) {
				r = {success:true};
			}
			else if (!r) {
				r = {};
			}

			// The delete callback needs a better response
			if (p.method === 'delete') {
				r = (!r || utils.isEmpty(r)) ? {success:true} : r;
			}

			// FORMAT RESPONSE?
			// Does self request have a corresponding formatter
			if (o.wrap && ((p.path in o.wrap) || ('default' in o.wrap))) {
				var wrap = (p.path in o.wrap ? p.path : 'default');
				var time = (new Date()).getTime();

				// FORMAT RESPONSE
				var b = o.wrap[wrap](r, headers, p);

				// Has the response been utterly overwritten?
				// Typically self augments the existing object.. but for those rare occassions
				if (b) {
					r = b;
				}
			}

			// Is there a next_page defined in the response?
			if (r && 'paging' in r && r.paging.next) {

				// Add the relative path if it is missing from the paging/next path
				if (r.paging.next[0] === '?') {
					r.paging.next = p.path + r.paging.next;
				}

				// The relative path has been defined, lets markup the handler in the HashFragment
				else {
					r.paging.next += '#' + p.path;
				}
			}

			// Dispatch to listeners
			// Emit events which pertain to the formatted response
			if (!r || 'error' in r) {
				promise.reject(r);
			}
			else {
				promise.fulfill(r);
			}
		});
	}