Ruby 4.1 リファレンスマニュアル

instance method Net::HTTPResponse#uri

uri -> URI | nilRuby 2.0.0 から[permalink][rdoc][edit]

このレスポンスの取得に使われた URI オブジェクトを返します。

リクエストの生成に URI オブジェクトを使わなかった場合は nil を返します。

require 'net/http'

uri = URI('http://www.example.com/index.html')
response = Net::HTTP.get_response(uri)
p response.uri # => #<URI::HTTP http://www.example.com/index.html>

[SEE_ALSO] Net::HTTPGenericRequest#uri