views:

36

answers:

1

I am trying to 1) post some XML to my Rails App (without using forms) 2) have my Rails App then parse the posted XML to create entries within my database

For example, I'd like to post

<transaction>
  <date>12-01-2010</date>
  <amount>1.00</amount>
</transaction> 
<transaction>
  <date>12-02-2010</date>
  <amount>2.00</amount>
</transaction>

Assuming I have a transaction controller. I'd then like to create an "upload" action that would allow me to parse the snippet above and create entries within my database.

From my research it seems like 1) can be accomplished with curl. But I'm not sure if that is right, because I don't know what URI to point the curl command to.

I am also not clear how to get the XML data within the "upload" action of my controller.

Any help would be appreciated.

Thank you!

+1  A: 

You have to set Header Content-type, send as POST request and then you have only worry about the XML posted content

matiit