Method: HTTP::Response#parse

Defined in:
lib/http/response.rb

#parse(as = nil) ⇒ Object

Parse response body with corresponding MIME type adapter.

Parameters:

  • as (#to_s) (defaults to: nil)

    Parse as given MIME type instead of the one determined from headers

Returns:

  • (Object)

Raises:



155
156
157
# File 'lib/http/response.rb', line 155

def parse(as = nil)
  MimeType[as || mime_type].decode to_s
end