Getting Raw Request XML

I’m writing a RESTful services application that receives XML in its
POST and PUT requests. It’s great that Rails parses out the XML into
the params hash, but occasionally I’d rather deal with the raw request
XML instead. How do I get at that?

Also, when writing functional tests for controllers is there a way to
send in the raw XML instead of the hash? In other words, something
like this:

def test_create
post :xml => ‘bobsmith</
last-name>’

Thanks!

Steve

[email protected] wrote:

I’m writing a RESTful services application that receives XML in its
POST and PUT requests. It’s great that Rails parses out the XML into
the params hash, but occasionally I’d rather deal with the raw request
XML instead. How do I get at that?

This might not help but I wanted to get the same thing from an xml-rpc
client and did it like this:

require ‘xmlrpc/client’

add a method to he lib to allow accesss to the raw

return data

class XMLRPC::Client

def mycall(method, *args)
request = create().methodCall(method, *args)
data = do_rpc(request, false)
end
end

server = XMLRPC::Client.new2(SERVER_URL)
data = server.mycall(blah)
puts data