hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christine <christ...@christine.nl>
Subject Re: Set Content type for multipart
Date Fri, 31 Oct 2008 11:02:01 GMT
You can extend FileBody, and extend "getContentType" to return what you
set with a new method "setContentType"

Christine

On Fri, 2008-10-31 at 09:06 +0100, Andreas Reichel wrote:
> Hi all,
> 
> I've tried several hours without success to create a multipart, that has
> Content-Type: image/png.
> This code:
> --
> File file = File.createTempFile("chart", ".png");
> ImageIO.write(rendImage, "png", file);
> reqEntity.addPart("fileName", new FileBody(file));
> --
> always creates octet/stream, that the server does'nt recognize.
> 
> 
> Please would you give me a friendly hint or even a small example?
> I thank you in advance!
> Best regards!
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
> For additional commands, e-mail: httpclient-users-help@hc.apache.org
-- 
dagdag is just a two character rotation of byebye
www.christine.nl


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


Mime
View raw message