Class: RestMan::Request::MakeHeaders
- Inherits:
-
ActiveMethod::Base
- Object
- ActiveMethod::Base
- RestMan::Request::MakeHeaders
- Defined in:
- lib/restman/request/make_headers.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/restman/request/make_headers.rb', line 7 def call headers = StringifyHeaders.call(default_headers).merge(StringifyHeaders.call(user_headers)) # override headers from the payload (e.g. Content-Type, Content-Length) if payload headers = payload.headers.merge(headers) end # merge in cookies = request. if && !.empty? if headers['Cookie'] warn('warning: overriding "Cookie" header with :cookies option') end headers['Cookie'] = end headers end |