Method: Browser::HTTP::Headers.parse

Defined in:
opal/browser/http/headers.rb

.parse(string) ⇒ Headers

Parse HTTP headers from a string.

Parameters:

  • string (String)

    the whole HTTP headers response

Returns:


12
13
14
# File 'opal/browser/http/headers.rb', line 12

def self.parse(string)
  self[string.lines.map { |l| l.chomp.split(/\s*:\s*/) }]
end