class Net::HTTPResponse

Public Instance Methods

begin_reading_body_hacked(sock, reqmethodallowbody) click to toggle source

Original reading_body with block semantics

def reading_body(sock, reqmethodallowbody) #:nodoc: internal use only

@socket = sock
@body_exist = reqmethodallowbody && self.class.body_permitted?
begin
  yield
  self.body   # ensure to read body
ensure
  @socket = nil
end

end

# File lib/net_http_hacked.rb, line 81
def begin_reading_body_hacked(sock, reqmethodallowbody)
  @socket = sock
  @body_exist = reqmethodallowbody && self.class.body_permitted?
end
end_reading_body_hacked() click to toggle source
# File lib/net_http_hacked.rb, line 86
def end_reading_body_hacked
  self.body
  @socket = nil
end