fixed inspects and logger

This commit is contained in:
HoneyryderChuck 2018-01-05 23:22:11 +00:00
parent 50adc95c46
commit ba4f6d9b01
3 changed files with 9 additions and 1 deletions

View File

@ -144,7 +144,7 @@ module HTTPX
buffer.clear
request.headers.each do |field, value|
buffer << "#{capitalized(field)}: #{value}" << CRLF
log { "<- HEADER: #{buffer.chomp.inspect}" }
log { "<- HEADER: #{buffer.chomp}" }
@buffer << buffer
buffer.clear
end

View File

@ -90,6 +90,10 @@ module HTTPX
nil
end
def inspect
"#<Request #{@verb.to_s.upcase} #{path} @headers=#{@headers.to_hash} @body=#{@body}>"
end
class Body
class << self
def new(*, options)

View File

@ -47,6 +47,10 @@ module HTTPX
ContentType.parse(@headers["content-type"])
end
def inspect
"#<Response @status=#{@status} @headers=#{@headers} @body=#{@body}>"
end
class Body
def initialize(response, threshold_size: , window_size: 1 << 14)
@response = response