The HTTP::Message class of LWP (from which the HTTP::Request is a sub-class) allows a subroutine reference (or closure) as the argument to the content() method. When the content is given as this sort of reference, it is repeatedly called for data until it returns either undef or an empty string.
This will be key to my implementing streaming of messages in RPC::XML. But it isn't really documented at this point, so I thought I'd share.
This problem is an interesting one. I'll be interested in how you implement your solution.
Re:Interesting
rjray on 2003-01-16T22:05:15
The problem is that the 3rd-party system we're working with uses an XML-RPC interface, but the data being sent is going to be huge. The goal is to avoid constructing the XML-RPC messages as in-memory strings, since they will be including base64 values that are encoded audio attachments.
The fact that I prefer not to back down on my existing compression support makes it harder, but I'm not going to back out a generally-useful feature like that in the name of a specific-requirement feature.
Matts made a good point that XLink would work really well in a case like this, but XML-RPC doesn't support that. And since this is a generalized remote-email interface, I can't reasonably ask them to implement oddness like recognizing a URL and downloading it to use as the attachment-in-question.
It's all terribly messy, and gets more and more frustrating with each passing day. Other problems and limitations have recently arisen, too, but at least most of those are someone else's headache.