You are viewing a plain text version of this content. The canonical link for it is here.
Posted to httpclient-users@hc.apache.org by Xinjun Chen <xj...@gmail.com> on 2006/08/22 15:33:30 UTC

HttpClient with attachment

Hi,

Could anyone provide me some link or idea on how to use HttpClient
with attachment?
I have googled it but did not find good information on that.


Regards,
Xinjun

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


Re: HttpClient with attachment

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Roland,

The MultipartRequestEntity works perfectly in my test program. :-).
Thank you very much for your help during my test of HttpClient.

Regards,
Xinjun

On 8/23/06, Xinjun Chen <xj...@gmail.com> wrote:
> Hi Roland,
>
> Thank you for your responsive and helpful reply.
>
> I am sorry that I didn't make my question clear. What I am looking for
> is sending SOAP with attachment. Before last email, I looked into the
> source code of Method.setRequestEntity() and found that existing
> request entity is always cleared before setting the new request
> entity.
>
> I think the MultipartRequestEntity is the one I am looking for. :-).
> Correct me if I am wrong. I will try it and let you know the result.
>
>
> Regards,
> Xinjun
>
> On 8/23/06, Roland Weber <ht...@dubioso.net> wrote:
> > Hello Xinjun,
> >
> > > Could anyone provide me some link or idea on how to use HttpClient
> > > with attachment?
> >
> > I have no idea what you mean. Attachments are something you put
> > in EMails. HttpClient is not an EMail client!?
> >
> > In case you want to send files with your HTTP requests, have a look
> > at FileRequestEntity (file only) and MultiPartRequestEntity (HTML
> > form parameters with files). The latter can handle a FilePartSource.
> >
> > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/FileRequestEntity.html
> > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/MultipartRequestEntity.html
> > http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/FilePartSource.html
> >
> > hope that helps,
> >  Roland
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
> >
> >
>

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


Re: HttpClient with attachment

Posted by Xinjun Chen <xj...@gmail.com>.
Hi Roland,

Thank you for your responsive and helpful reply.

I am sorry that I didn't make my question clear. What I am looking for
is sending SOAP with attachment. Before last email, I looked into the
source code of Method.setRequestEntity() and found that existing
request entity is always cleared before setting the new request
entity.

I think the MultipartRequestEntity is the one I am looking for. :-).
Correct me if I am wrong. I will try it and let you know the result.


Regards,
Xinjun

On 8/23/06, Roland Weber <ht...@dubioso.net> wrote:
> Hello Xinjun,
>
> > Could anyone provide me some link or idea on how to use HttpClient
> > with attachment?
>
> I have no idea what you mean. Attachments are something you put
> in EMails. HttpClient is not an EMail client!?
>
> In case you want to send files with your HTTP requests, have a look
> at FileRequestEntity (file only) and MultiPartRequestEntity (HTML
> form parameters with files). The latter can handle a FilePartSource.
>
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/FileRequestEntity.html
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/MultipartRequestEntity.html
> http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/FilePartSource.html
>
> hope that helps,
>  Roland
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>

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


Re: HttpClient with attachment

Posted by Roland Weber <ht...@dubioso.net>.
Hello Xinjun,

> Could anyone provide me some link or idea on how to use HttpClient
> with attachment?

I have no idea what you mean. Attachments are something you put
in EMails. HttpClient is not an EMail client!?

In case you want to send files with your HTTP requests, have a look
at FileRequestEntity (file only) and MultiPartRequestEntity (HTML
form parameters with files). The latter can handle a FilePartSource.

http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/FileRequestEntity.html
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/MultipartRequestEntity.html
http://jakarta.apache.org/commons/httpclient/apidocs/org/apache/commons/httpclient/methods/multipart/FilePartSource.html

hope that helps,
  Roland

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