Forum: Ruby testing web services

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
95e2092707d6ee9e7634e169f713cc38?d=identicon&s=25 Jade CKS (kc_123)
on 2014-07-18 06:02
Hi I am trying to test REST services that returns both json and xml
payload
I have something like this, expecting the webservice to return in xml
only. But default payload returned is in json

module WebServiceHelper

 @@last_response

  def wsh_get_response(invoice_number)
    @@last_response = HTTParty.get("url....")

  end

  def wsh_view_entire_xml_payload
    xml_doc = Nokogiri::XML(@@last_response.body)
    puts xml_doc
  end

Does anyone know if it can be converted to xml?
This topic is locked and can not be replied to.