Bundling REST POSTs?

I will be sending about 3000 REST POSTs every 15 seconds. What is the
best way to bundle them? Would I have to create a custom action and/or
controller unbundle them? Is there an easier way through a plugin or
library?

thanks
chirag

On 6/21/07, chirag [email protected] wrote:

I will be sending about 3000 REST POSTs every 15 seconds. What is the
best way to bundle them? Would I have to create a custom action and/or
controller unbundle them? Is there an easier way through a plugin or
library?

I just committed a patch that handles xml arrays. Try this in your
console to see what the xml should look like:

posts = Post.find(:all)
xml = posts.to_xml(:root => ‘posts’)
puts xml

It works both ways:

Hash.from_xml(xml)

If you’re POSTing to an xml-formatted rails action, the parsing to the
params hash should be all handled for you of course.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com

On Jun 21, 10:22 am, “Rick O.” [email protected] wrote:

I just committed a patch that handles xml arrays. Try this in your
console to see what the xml should look like:

Rick, thanks! What do you mean “by committed a patch”? A patch to
what?

If you’re POSTing to an xml-formatted rails action, the parsing to the
params hash should be all handled for you of course.

What do you mean by “handled for you”? I created the controllers and
actions using the scaffold_resource generator. Are you saying that the
existing POST action will recognize that the POSTs are bundled in an
array and process each individual one all automatically?

On 6/22/07, chirag [email protected] wrote:

what?
to Rails.

If you’re POSTing to an xml-formatted rails action, the parsing to the
params hash should be all handled for you of course.

What do you mean by “handled for you”? I created the controllers and
actions using the scaffold_resource generator. Are you saying that the
existing POST action will recognize that the POSTs are bundled in an
array and process each individual one all automatically?

It’ll parse the xml into params for you.


Rick O.
http://lighthouseapp.com
http://weblog.techno-weenie.net
http://mephistoblog.com