class Net::HTTPResponse

PATCH: Net::HTTPResponse to include actual Java response object ORIGINAL FROM: Ruby 3.1.0, ‘lib/net/http/response.rb’

Attributes

java_response[RW]

Public Class Methods

original_read_new(sock)
Alias for: read_new
read_new(sock) click to toggle source
# File lax/__internal__/patches/patch-net-http.rb, line 109
def read_new(sock)
  if sock.is_a?(com.lansa.lax.ruby.httpclient::RubyHttpClientResponse)
    httpv, code, msg = sock.http_version, sock.code, sock.message
    res = response_class(code).new(httpv, code, msg)
    sock.headers.each do |key, values|
      values.each do |value|
        res.add_field key, value
      end
    end
    res.java_response = sock
    res
  else
    original_read_new(sock)
  end
end
Also aliased as: original_read_new

Public Instance Methods

body() click to toggle source
# File lax/__internal__/patches/patch-net-http.rb, line 130
def body
  if java_response
    java_response.body
  else
    original_body
  end
end
Also aliased as: original_body
original_body()
Alias for: body