hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nicholas Rahn <n...@mnc.ch>
Subject Re: Parsing Multipart
Date Tue, 14 Dec 2004 08:44:26 GMT
You could also use the Jakarta Commons FileUpload package instead of
JavaMail.  We use this to parse multi-part http requests, but i think it
should be usable as well for multi-part http responses.

nick

On Mon, 2004-12-13 at 18:29 +0100, Ortwin Gl├╝ck wrote:
> 
> Vijay wrote:
> > I'm currently using httpclient to post the multipart data to an URL
> > and read the multipart response back. JavaMail doesn't support
> > http/https protocol requests, correct?
> 
> You are correct. But I didn't mean to use JavaMail for the transfer. 
> Only use it for parsing. Something along the lines of:
> 
> DataSource ds = new HttpClientDataSource(url);
> MimeMultipart top = new MimeMultipart(ds);
> for (int i=0; i < top.getCount(); i++) {
>    BodyPart part = top.getBodyPart(i);
>    // do something with the part here
> }
> 
> 
> You can then hide all Http code in the HttpClientDataSource implementation.
> 
> How about this?
> 
>     -og
> 
> 
> 
> > I saw the warning message on logs for using String. Thanks. I will use
> > getResponseAsStream().
> > 
> > Thanks
> > Vijay
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-dev-help@jakarta.apache.org


Mime
View raw message