Class: Rig::HTTPHeader
- Inherits:
-
Hash
- Object
- Hash
- Rig::HTTPHeader
- Defined in:
- lib/rig/http_header.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ HTTPHeader
constructor
A new instance of HTTPHeader.
- #to_s ⇒ Object
Constructor Details
#initialize(options) ⇒ HTTPHeader
Returns a new instance of HTTPHeader.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/rig/http_header.rb', line 4 def initialize http_method = [:http_method] path = [:path] header = { "" => "#{http_method} #{path} HTTP/1.1", "Host" => [:host], "Origin" => "localhost", "Content-Length" => [:content_length], "Content-Type" => [:content_type] }.merge( ([:custom_header] || {}) ).merge( "Connection" => "close" ) merge!( header ) end |