Extracts the base url of the API from JSON Schema
 @return [String, nil]
 @example
   base_url_from_schema #=> "https://api.example.com/"
514105
def base_url_from_schema
      json_schema.links.find do |link|
        if link.href && link.rel == "self"
          return link.href
        end
      end
    end
518207
def base_url(klass, space_id, resource_id=None, public=False, environment_id=None, **kwargs):
        

        if public:
            environment_slug = ""
            if environment_id is not None:
                environment_slug = "/environments/{0}".format(environment_id)
            return "spaces/{0}{1}/public/content_types".format(space_id, environment_slug)
        return super(ContentType, klass).base_url(
            space_id,
            resource_id=resource_id,
            environment_id=environment_id,
            **kwargs
        )
413082
def loadSchema(uri, base_uri=None):
    

    # uri to use for reporting errors - include base uri if any
    if uri in _loaded_schemas:
        return _loaded_schemas[uri]

    error_uri = uri
    if base_uri is not None:
        error_uri += ' (base URI %s)' % base_uri


    try:
        logger.debug('Loading schema %s' % uri)
        _loaded_schemas[uri] = etree.XMLSchema(etree.parse(uri,
                                                           parser=_get_xmlparser(),
                                                           base_url=base_uri))
        return _loaded_schemas[uri]
    except IOError as io_err:
        # add a little more detail to the error message - but should still be an IO error
        raise IOError('Failed to load schema %s : %s' % (error_uri, io_err))
    except etree.XMLSchemaParseError as parse_err:
        # re-raise as a schema parse error, but ensure includes details about schema being loaded
        raise etree.XMLSchemaParseError('Failed to parse schema %s -- %s' % (error_uri, parse_err))
95751
def get(url, params={}, options={})
      FreebaseAPI.logger.debug("GET #{url}")
      params[:key] = @key if @key
      options = { format: options[:format], query: params }
      options.merge!(@proxy_options)
      response = self.class.get(url, options)
      handle_response(response)
    end
523112
def url
      sch = @options[:ssl] ? "https" : "http"
      hosts = Array(@options[:host])
      @url ||= if hosts.first.include?(":")
                 URI("#{sch}://[#{hosts.first}]:#{port}").to_s
               else
                 URI("#{sch}://#{hosts.first}:#{port}").to_s
               end
    end
1144213
def base_url(klass, space_id='', resource_id=None, environment_id=None, **kwargs):
        

        url = "spaces/{0}".format(
            space_id)

        if environment_id is not None:
            url = url = "{0}/environments/{1}".format(url, environment_id)

        url = "{0}/{1}".format(
            url,
            base_path_for(klass.__name__)
        )

        if resource_id:
            url = "{0}/{1}".format(url, resource_id)

        return url
635834
def _method_url(self, method_name):
        
        return "{base_url}/api/{api}/{method}".format(
            base_url=self._base_url(),
            api=self.api_version,
            method=method_name
        )
281022
function(){
      var base = Utils.unwrapValue(this, 'baseUrl') || (this.collection && Utils.unwrapValue(this.collection, 'url'));
      if(typeof base === undefined) throw "Missing baseUrl or collection.url properties";
      if(this.isNew()) return base;
      return base + (base[base.length-1] === '/' ? '' : '/') + this.id();
    }
1169195
def url_path
      # Get the path component of the URL as a relative path
      filename = URI.parse(url).path
      filename.slice!(0) # Remove the leading /
      # Return the path with '.json' extension if not already present
      filename.end_with?('.json') ? filename : "#{filename}.json"
    rescue URI::InvalidComponentError, URI::InvalidURIError
      # Return nil if the URL is invalid
      nil
    end
1257537
def _construct_url(self, base_api, params):
        
        params['key'] = self.api_key
        return super(PickPoint, self)._construct_url(base_api, params)
767217
def url(path = nil, scheme: nil)
      return path if path && URI.parse(path).scheme
      uri = URI::Generic.build(
        scheme: scheme || env['rack.url_scheme'],
        host: env['SERVER_NAME'],
        port: env['SERVER_PORT'].to_i,
        path: env['scorched.root_path'],
      )
      if path
        path[0,0] = '/' unless path[0] == '/'
        uri.to_s.chomp('/') << path
      else
        uri.to_s
      end
    end
786437
def get_api_url(server):
    
    parsed = urlparse(server)
    base_url = parsed.netloc if parsed.netloc else parsed.path
    base_url.replace('/', '')
    return 'https://' + base_url + '/apiv1'
627447
def get_my_drive
      url = base_api_url + "/me/drive"
      @my_drive = JSON.parse(HTTParty.get(url,headers: set_headers).body)
    end
1083605
private void extractHash() {
		String hash = Window.Location.getHash();

		GWT.log("DynamicUrlController hash => " + hash);

		if (null != hash && !hash.isEmpty()) {
			urlParser.parseHash(hash.substring(1));
		}
	}
577244
def base_string_uri
      Addressable::URI.parse(@attributes['uri'].to_s).tap do |uri|
        uri.scheme = uri.scheme.downcase if uri.scheme
        uri.host = uri.host.downcase if uri.host
        uri.normalize!
        uri.fragment = nil
        uri.query = nil
      end.to_s
    end
573167
def get_url_base_from_url_token(
        self, url_api_token: str = "https://id.api.isogeo.com/oauth/token"
    ):
        
        in_parsed = urlparse(url_api_token)
        api_url_base = in_parsed._replace(
            path="", netloc=in_parsed.netloc.replace("id.", "")
        )
        return api_url_base.geturl()
971286
def getObjectFromUrl(url,type=nil)
      method = 'getObjectFromUrl'
      type = BaseObj if not type
      args = {:url=>url}
      return_object type,method,args,true
    end