Display incoming xml request in Rails
Hey guys, Is there an easy way to display the complete xml request I'm getting posted to one of my methods? Thanks a 开发者_如何转开发lot
If you want to see the actual XML that is being posted rather than a params hash try
xml_data = request.raw_post
Then to get a hash out of that you could do
hash_from_xml_data = Hash.from_xml(xml_data)
I'm inferring a bit, but you probably want request.body
.
An easy, though slightly dirty, way to view it is to raise it as an error in your controller: raise request.body
精彩评论