Method: ROM::HTTP::Dataset#headers

Defined in:
lib/rom/http/dataset.rb

#headersHash

Return request headers

Merges default headers from the Gateway configuration and the current Dataset

Examples:

config = { Accepts: 'application/json' }
users  = Dataset.new(config, headers: { 'Cache-Control': 'no-cache' }
users.headers
# => {:Accepts => "application/json", :'Cache-Control' => 'no-cache'}

Returns:

  • (Hash)


63
64
65
# File 'lib/rom/http/dataset.rb', line 63

def headers
  config.fetch(:headers, {}).merge(options.fetch(:headers, {}))
end