Method: Addressable::URI#request_uri

Defined in:
lib/addressable/uri.rb

#request_uriString

The HTTP request URI for this URI. This is the path and the query string.

Returns:

  • (String)

    The request URI required for an HTTP request.



1774
1775
1776
1777
1778
1779
1780
# File 'lib/addressable/uri.rb', line 1774

def request_uri
  return nil if self.absolute? && self.scheme !~ /^https?$/i
  return (
    (!self.path.empty? ? self.path : SLASH) +
    (self.query ? "?#{self.query}" : EMPTY_STR)
  )
end