hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Roland Weber <ROLWE...@de.ibm.com>
Subject Re: [HttpClient 3.0.1] cannot set Content-Type when using MultipartRequestEntity
Date Mon, 14 May 2007 10:53:42 GMT
Hello Xinjun,

> I constructed a PostMethod and set MultipartRequestEntity. I put the
> SOAPRequest as a StringPart, and the attachment as a FilePart. 
> does not generate the desired MIME Request. I want to specify the 
> content-type as "text/xml; charset=UTF-8", but HttpClient just generated
> "text/plain; charset=US-ASCII" even if I explicitly set content-type 

You can override MultipartRequestEntity.getContentType() to specify
the value for the Content-Type header. An explicitly set header will
be overwritten.

hope that helps,

View raw message