instance method
URI::WS#request_uri
request_uri
lib/uri/ws.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/uri/ws.rb, line 74
def request_uri
return unless @path
url = @query ? "#@path?#@query" : @path.dup
url.start_with?(?/.freeze) ? url : ?/ + url
end
Description
Returns the full path for a WS URI, as required by Net::HTTP::Get.
If the URI contains a query, the full path is URI#path + ‘?’ + URI#query. Otherwise, the path is simply URI#path.
Example:
Example
uri = URI::WS.build(path: '/foo/bar', query: 'test=true') uri.request_uri # => "/foo/bar?test=true"