Hi,
I have the following piece of code, where I create a POST
request, based on the class StringProducer, a simple
implementation of ContentProducer that output a string (see
below):
// the request entity
ContentProducer prod = new StringProducer(content);
EntityTemplate entity = new EntityTemplate(prod);
entity.setChunked(false);
// the POST method, with the above entity
HttpPost post = new HttpPost(uri);
post.setEntity(entity);
client.execute(post);
StringProducer is simply:
private static class StringProducer
implements ContentProducer
{
public StringProducer(String content) {
myContent = content;
}
@Override
public void writeTo(OutputStream out) throws IOException {
out.write(myContent.getBytes());
}
private String myContent;
}
Note the following statement above:
entity.setChunked(false);
But in the logs, I get the following:
[DEBUG] wire - >> "POST ***** HTTP/1.1[EOL]"
[DEBUG] wire - >> "Transfer-Encoding: chunked[EOL]"
[DEBUG] wire - >> ...
Is that normal?
Regards,
--
Florent Georges
http://www.fgeorges.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]