Goto the given URL

 @param [String] uri The url.
 @param [Hash] (optional) a Hash of HTTP headers to use for the request.

 @return [String] The url.
198122
def goto(uri, headers = nil)
      uri = "http://#{uri}" unless uri =~ %r{://}

      request = HtmlUnit::WebRequest.new(::Java::JavaNet::URL.new(uri))

      request.setAdditionalHeaders(headers) if headers
      request.setCharset(@charset)

      rescue_status_code_exception do
        self.page = @webclient.getPage(request)
      end

      url()
    end
286867
def get(url, options={}, &block)
      http_options = options.merge(@basic_options)
      if block_given?
        RestClient.get(url, http_options, &block)
      else
        RestClient.get(url, http_options)
      end
    end
1142534
private static URI toURI(String encodedUrl) {
    try {
      return new URI(encodedUrl);
    } catch (URISyntaxException e) {
      throw new IllegalArgumentException(e);
    }
  }
1014563
def response_of_uri(uri)
      begin
        Net::HTTP.start(uri.host, uri.port) do |http|
          http.head(uri.path.size > 0 ? uri.path : "/").code
        end
      rescue Exception => e
        "Error"
      end
    end
393282
public static String getUri(String uri) throws IOException {
        CloseableHttpClient c = newHttpClient(new URL(uri));
        HttpGet get = new HttpGet(uri);
        LOG.debug("GET {}", uri);
        CloseableHttpResponse res = c.execute(get, HttpClientContext.create());
        return checkResponse(res);
    }
1215389
def join_uri(scheme, userinfo, host, port, registry, path, opaque, query, fragment)
      URI::Generic.new(scheme, userinfo, host, port, registry, path, opaque, query, fragment).to_s
    end
146788
def get
      uri = self.url
      http = Net::HTTP.new(uri.host, uri.port)

      if @ssl
        http.use_ssl = true
        http.verify_mode = OpenSSL::SSL::VERIFY_NONE
      end

      request = Net::HTTP::Get.new(uri.request_uri)

      if @auth
        request.basic_auth(@username, @password)
      end

      request["User-Agent"] = "Monit Ruby client #{Monit::VERSION}"

      begin
        response = http.request(request)
      rescue Errno::ECONNREFUSED
        return false
      end

      if (response.code =~ /\A2\d\d\z/)
        @xml = response.body
        return self.parse(@xml)
      else
        return false
      end
    end
513018
def get(path: nil, headers: {}, query: {})
      execute(method: :get, path: path, query: query, headers: headers)
    end
1356792
def _get_connection(self, uri, headers=None):
    
    connection = None
    if uri.scheme == 'https':
      if not uri.port:
        connection = httplib.HTTPSConnection(uri.host)
      else:
        connection = httplib.HTTPSConnection(uri.host, int(uri.port))
    else:
      if not uri.port:
        connection = httplib.HTTPConnection(uri.host)
      else:
        connection = httplib.HTTPConnection(uri.host, int(uri.port))
    return connection
787720
def fget(url, **options)
      uri = _assert_uri(url)
      Responses::ResponsePromise.new { get(uri, options) }
    end
1357606
def get_request(hash=true)
        resp = RestClient.get get_url
        hash ? Hash.from_xml(resp).it_keys_to_sym : resp
      end
531261
def parse_uri(uri: str) -> WebSocketURI:
    
    parsed = urllib.parse.urlparse(uri)
    try:
        assert parsed.scheme in ["ws", "wss"]
        assert parsed.params == ""
        assert parsed.fragment == ""
        assert parsed.hostname is not None
    except AssertionError as exc:
        raise InvalidURI(uri) from exc

    secure = parsed.scheme == "wss"
    host = parsed.hostname
    port = parsed.port or (443 if secure else 80)
    resource_name = parsed.path or "/"
    if parsed.query:
        resource_name += "?" + parsed.query
    user_info = None
    if parsed.username or parsed.password:
        user_info = (parsed.username, parsed.password)
    return WebSocketURI(secure, host, port, resource_name, user_info)
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
1098225
def geturi(self):
        
        scheme, authority, path, query, fragment = self

        # RFC 3986 5.3. Component Recomposition
        result = []
        if scheme is not None:
            result.extend([scheme, self.COLON])
        if authority is not None:
            result.extend([self.SLASH, self.SLASH, authority])
        result.append(path)
        if query is not None:
            result.extend([self.QUEST, query])
        if fragment is not None:
            result.extend([self.HASH, fragment])
        return self.EMPTY.join(result)
138226
public static URI getRequestURI(URI requestURI, String hostHeader, IoSession session) {
        boolean secure = SslUtils.isSecure(session);
        String authority = HttpUtils.getHostAndPort(hostHeader, secure);
        // Use getRawPath to get the un-decoded path; getPath returns the post-decode value.
        // This is required to handle special characters like spaces in the URI (KG-831).
        URI uri = URI.create("//" + authority + requestURI.getRawPath());
        return uri;
    }
1215682
def goto(file_path)
      html = File.read(file_path)
      @driver = Nokogiri::HTML.parse(html)
    end
300004
def oauth_header
      uri = uri_base + @options[:path].to_s

      # The hash SimpleOAuth accepts is slightly different from that of
      # ROAuth.  To preserve backward compatability, fix the cache here
      # so that the arguments passed in don't need to change.
      oauth = {
        :consumer_key => @options[:oauth][:consumer_key],
        :consumer_secret => @options[:oauth][:consumer_secret],
        :token => @options[:oauth][:access_key],
        :token_secret => @options[:oauth][:access_secret]
      }

      data = ['POST', 'PUT'].include?(@options[:method]) ? params : {}

      SimpleOAuth::Header.new(@options[:method], uri, data, oauth)
    end