Method: HTTPX::Headers#merge

Defined in:
lib/httpx/headers.rb

#merge(other) ⇒ Object

merges headers with another header-quack. the merge rule is, if the header already exists, ignore what the other headers has. Otherwise, set



46
47
48
49
50
51
52
53
# File 'lib/httpx/headers.rb', line 46

def merge(other)
  # TODO: deep-copy
  headers = dup
  other.each do |field, value|
    headers[field] = value
  end
  headers
end