class GData::HTTP::Response

An extremely simple class to hold the values of an HTTP response.

Attributes

body[RW]

The body of the HTTP response.

headers[RW]

The headers of the HTTP response.

status_code[RW]

The HTTP response code.

Public Instance Methods

to_xml() click to toggle source

Converts the response body into a REXML::Document

# File lib/gdata/http/response.rb, line 31
def to_xml
  if @body
    begin
      return REXML::Document.new(@body).root
    rescue
      raise GData::Client::Error, "Response body not XML."
    end
  else
    return nil
  end
end