Call either the secure or the base web url
498520
def base_web_method_call( web_options, options ={}, url )
      options     = Smile::ParamConverter.clean_hash_keys( options )
      web_options = Smile::ParamConverter.clean_hash_keys( web_options )

      params = default_params.merge( web_options )
      params.merge!( options ) if( options )

      logger.info( params.inspect )

      json = RestClient.post( url, params ).body
      upper_hash_to_lower_hash( Smile::Json.parse( json ) )
		end
298552
function formatURL(httpsOptions) {
  var url;
  if (httpsOptions.protocol) {
    url = httpsOptions.protocol;
  } else {
    url = 'https:';
  }
  url += '//';
  if (httpsOptions.auth) {
    url += httpsOptions.auth + '@';
  }
  if (httpsOptions.host) {
    url += httpsOptions.host;
  } else if (httpsOptions.hostname) {
    url += httpsOptions.hostname;
  } else {
    url += 'localhost';
  }
  if (httpsOptions.port && !url.includes(':' + httpsOptions.port)) {
    url += ':' + httpsOptions.port;
  }
  if (httpsOptions.path) {
    url += httpsOptions.path;
  } else {
    url += '/';
  }
  return url;
}
69006
def _get_api_url(self, secure=None, **formatters):
        '''
        '''
        if self.endpoint is None:
            raise NotImplementedError('endpoint must be defined on a subclass')
        if secure is None:
            secure = self.secure
        if secure:
            api_url = POSTMARK_API_URL_SECURE
        else:
            api_url = POSTMARK_API_URL
        url = urljoin(api_url, self.endpoint)
        if formatters:
            url = url.format(**formatters)
        return url
515288
private static String createBaseUrl(AuthleteConfiguration configuration)
    {
        String baseUrl = configuration.getBaseUrl();

        // If the configuration does not contain a base URL.
        if (baseUrl == null)
        {
            throw new IllegalArgumentException("The configuration does not have information about the base URL.");
        }

        try
        {
            // Check whether the format of the given URL is valid.
            new URL(baseUrl);
        }
        catch (MalformedURLException e)
        {
            // The format of the base URL is wrong.
            throw new IllegalArgumentException("The base URL is malformed.", e);
        }

        if (baseUrl.endsWith("/"))
        {
            // Drop the '/' at the end of the URL.
            return baseUrl.substring(0, baseUrl.length() - 1);
        }
        else
        {
            // Use the value of the base URL without modification.
            return baseUrl;
        }
    }
103998
def base_url(root):
    """"""
    for attr, value in root.attrib.iteritems():
        if attr.endswith('base') and 'http' in value:
            return value
    return None
992811
def _construct_url(self, base_api, params):
        
        params['key'] = self.api_key
        return super(OpenMapQuest, self)._construct_url(base_api, params)
1110856
function _validateBaseUrl(url) {
        var result = "";
        // Empty url means "no server mapping; use file directly"
        if (url === "") {
            return result;
        }

        var obj = PathUtils.parseUrl(url);
        if (!obj) {
            result = Strings.BASEURL_ERROR_UNKNOWN_ERROR;
        } else if (obj.href.search(/^(http|https):\/\//i) !== 0) {
            result = StringUtils.format(Strings.BASEURL_ERROR_INVALID_PROTOCOL, obj.href.substring(0, obj.href.indexOf("//")));
        } else if (obj.search !== "") {
            result = StringUtils.format(Strings.BASEURL_ERROR_SEARCH_DISALLOWED, obj.search);
        } else if (obj.hash !== "") {
            result = StringUtils.format(Strings.BASEURL_ERROR_HASH_DISALLOWED, obj.hash);
        } else {
            var index = url.search(/[ \^\[\]\{\}<>\\"\?]+/);
            if (index !== -1) {
                result = StringUtils.format(Strings.BASEURL_ERROR_INVALID_CHAR, url[index]);
            }
        }

        return result;
    }
1328692
def _get_url(ssl, url, port, path):
    '''
    
    '''
    if ssl:
        return 'https://{0}:{1}/management/domain/{2}'.format(url, port, path)
    else:
        return 'http://{0}:{1}/management/domain/{2}'.format(url, port, path)
581701
function(serverUrl) {
  var parsedUrl = url.parse(serverUrl);
  if (!parsedUrl.hostname) {
    throw new Error('Invalid server URL: ' + serverUrl);
  }

  /**
   * Base options for each request.
   * @private {!Object}
   */
  this.options_ = {
    host: parsedUrl.hostname,
    path: parsedUrl.pathname,
    port: parsedUrl.port
  };
}
542107
def get_base_url(use_ssl, instance=None, host=None):
        

        if instance is not None:
            host = ("%s.service-now.com" % instance).rstrip('/')

        if use_ssl is True:
            return "https://%s" % host

        return "http://%s" % host
96834
def OpenUrlWithBasicAuth(url, user='root', pwd=''):
   
   return requests.get(url, auth=HTTPBasicAuth(user, pwd), verify=False)
1036886
function buildURL(dbName, opts) {
  var authentication
  opts.scheme = opts.scheme || 'http'
  opts.host   = opts.host   || '127.0.0.1'
  opts.port   = opts.port   || '5984'

  if (has(opts, 'auth')) {
    if (typeof opts.auth === 'object') {
      authentication = opts.auth.username + ':' + opts.auth.password + '@'
    }
  }

  return opts.scheme + '://' + authentication + opts.host + ':' + opts.port + '/' + dbName
}
1364855
protected String getWebSocketURL(ChannelHandlerContext ctx, HttpRequest req) {
        boolean isSecure = ctx.pipeline().get(SslHandler.class) != null;
        return (isSecure ? SCHEME_SECURE_WEBSOCKET : SCHEME_WEBSOCKET) + req.getHeaders().get(HttpHeaderNames.HOST) + req.getUri() ;
    }
789394
def rewrite_to_secure_url(url, secure_base=None):
    
    if secure_base is None:
        secure_base = cfg.get('CFG_SITE_SECURE_URL')
    url_parts = list(urlparse(url))
    url_secure_parts = urlparse(secure_base)
    url_parts[0] = url_secure_parts[0]
    url_parts[1] = url_secure_parts[1]
    return urlunparse(url_parts)
597585
def __valid_url(cls, url):
        """"""
        bits = urlparse(url)
        return ((bits.scheme == "http" or bits.scheme == "https") and
                _PATTERN_URL_PART.match(bits.netloc) and
                _PATTERN_URL_PART.match(bits.path))
640084
function resolveUrl(base, url) {
  var value = '';
  if (url.indexOf('://') != -1) {
    // Likely absolute...
    value = url;
  } else {
    // Combine by smashing together and letting the browser figure it out.
    if (url.length && url[0] == '/') {
      // URL is absolute, so strip base to just host.
      var i = url.indexOf('://') + 3;
      i = url.indexOf('/', i);
      if (i != -1) {
        value = base + url;
      } else {
        value = base.substr(0, i) + url;
      }
    } else {
      // URL is relative, so combine with base.
      if (base[base.length] == '/') {
        value = base + '/' + url;
      } else {
        value = base + '/../' + url;
      }
    }
  }
  return value;
}
901447
function URL(input, base) {
        var baseURL;
        if (base) {
            base = base.href || base;
            baseURL = _parseURL(base);
            if (!baseURL || !baseURL.scheme) {
                throw new SyntaxError();
            }
            Object.defineProperty(this, "_baseURL", {
                value: baseURL
            });
        }

        var url = _parseURL(input, baseURL);
        if (!url) {
            throw new SyntaxError();
        }

        Object.defineProperty(this, "_input", {
            value: input,
            writable: true
        });

        Object.defineProperty(this, "_url", {
            value: url,
            writable: true
        });

        var query = new URLQuery(this);
        Object.defineProperty(this, "query", {
            get: function() {
                return this._url ? query : null;
            },
            enumerable: true
        });
    }