Method: Gem::Net::HTTPHeader#to_hash

Defined in:
lib/rubygems/net-http/lib/net/http/header.rb

#to_hashObject

Returns a hash of the key/value pairs:

req = Gem::Net::HTTP::Get.new(uri)
req.to_hash
# =>
{"accept-encoding"=>["gzip;q=1.0,deflate;q=0.6,identity;q=0.3"],
 "accept"=>["*/*"],
 "user-agent"=>["Ruby"],
 "host"=>["jsonplaceholder.typicode.com"]}


477
478
479
# File 'lib/rubygems/net-http/lib/net/http/header.rb', line 477

def to_hash
  @header.dup
end