This method might help: http://ruby-doc.org/stdlib-1.9.2/libdoc/uri/rdoc/URI/HTTP.html#method-i-request_uri