Joshua Hoblitt <[EMAIL PROTECTED]> writes:

> I've been kicking around the idea for this module for a few days now
> and I'd like to commit it to code.  The module I'm proposing would
> be called C<HTTP::Multipart>.  It would accept an C<HTTP::Response>
> object and determine if it indeed does contain a multipart HTTP
> message.  If it does then the passed object would be cloned once for
> every part in the message and the 'Content-Length', 'Content-Type',
> and 'Content-Range' headers would be adjusted along with the
> C<content> value to reflect one of the parts.  Then a list of
> non-multipart C<HTTP::Response> objects would be returned.  I
> believe this would simplify handling multipart responses.
> 
> 1) Is this a good idea?

The usecase for this seems a bit unclear to me.  How would you use
this module?  I don't understand what needs handling of multipart
responses requires.

> 2) Is HTTP::Multipart a good name?

I think all that would be needed for this is a method on
HTTP::Message.  It could for instance be called 'parts'.  If the
method is not too long and generally useful then it should just go
into that module.

> 3) Is it appropriate to require C<HTTP::Response> objects?  Would
> just requiring objects to be ISA C<HTTP::Message> or
> C<HTTP::Headers> be better?

It is best not to require any specific object at all.  Just depend to
a certain interface, i.e. a set of methods to be implemented.

> 4) Should there be an C<HTTP::Multipart> object that contains a list
> of modified C<HTTP::Response> objects or would a class method be
> sufficient?

What you described above appear to be a simple function that takes one
HTTP::Response (or HTTP::Message) and breaks it into (possibly) many
smaller.  I don't see any need for an extra object or class here.

> 5) if a class method is sufficient, would should it's name be?
> (ie., C<parase>?)

What does 'parase' mean?

Regards,
Gisle

Reply via email to