SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: POST XML data

  1. #1
    SitePoint Member
    Join Date
    Nov 2008
    Posts
    8
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    POST XML data

    I'm working on a RoR backend for a Flash app. The Flash needs to pass me XML that I need to parse and dump into one or more database tables. But I can't find any info on how to parse XML passed to me, as opposed to parsing XML from somewhere else. How do I process XML posted to my controller action?

    Little more info: The xml is coming in the body of the POST. I can't seem to get to that POST body. Any ideas how I can read the POST body?

    Thanks!
    Last edited by danpberger; Jul 9, 2009 at 10:19.

  2. #2
    SitePoint Wizard silver trophy kyberfabrikken's Avatar
    Join Date
    Jun 2004
    Location
    Copenhagen, Denmark
    Posts
    6,157
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Use body to get the request body. You can then pass it to an xml-parser. In Ruby, there are quite a few to chose from, but the simplest to use is probably rexml (It requires no external libraries, and it's included with rails)


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •