End of Life Ruby 3.2 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Net::HTTPResponse#body
body
lib/net/http/response.rb
View on GitHub ↗
# File tmp/rubies/ruby-3.2.0/lib/net/http/response.rb, line 379
def body
read_body()
end
Returns the full entity body.
Calling this method a second or subsequent time will return the string already read.
Example
http.request_get('/index.html') {|res| puts res.body } http.request_get('/index.html') {|res| p res.body.object_id # 538149362 p res.body.object_id # 538149362 }