Forum: Ruby testing web services

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

module WebServiceHelper


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


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

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