class Net::HTTPResponse

Extensions to standard HTTPResponse

Public Instance Methods

deserialize() click to toggle source

Find out the content type of the response and convert it the proper object

# File lib/arest.rb, line 8
def deserialize
  case content_type
  when "application/xml"
    Hash.from_xml(body).deep_symbolize_keys
  when "application/json"
    JSON.parse body, symbolize_names: true
  else
    body
  end
end
ok?() click to toggle source

True if response is HTTP OK

# File lib/arest.rb, line 20
def ok?
  Net::HTTPSuccess === self || Net::HTTPRedirection === self
end