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

instance method Net::HTTPResponse#http_version

http_version -> String[permalink][rdoc][edit]

サーバがサポートしている HTTP のバージョンを文字列で返します。

require 'net/http'

uri = "http://www.example.com/index.html"
response = Net::HTTP.get_response(URI.parse(uri))
p response.http_version # => "1.1"