On Wed, 2016-01-13 at 00:33 -0800, Karthik R wrote: > > Hi all, > > > > Just wanted to post a quick update. I have changed it as below and it works: > > > > NByteArrayEntity nbe = new > NByteArrayEntity(data.toString().getBytes("UTF-8")); > > post.setEntity(nbe); > > post.addHeader(HttpHeaders.AUTHORIZATION,"Basic "+authStr); > > post.addHeader(HttpHeaders.CONTENT_TYPE,contentType); > > I stopped using MultipartEntityBuilder. It doesn't really give NIO support I > think because it needs to be wrapped in a BufferedHttpEntity (this makes a > copy of the content in memory). I am not sure if the above reasoning is > correct or complete. Perhaps some one can clarify. > >
The multipart entity implementation in HttpClient is inherently synchronous (blocking). It cannot be used with the async version of HC without buffering. However, one can develop a custom HttpAsyncContentProducer that streams out parts of multipart entity without blocking. Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: httpclient-users-unsubscr...@hc.apache.org For additional commands, e-mail: httpclient-users-h...@hc.apache.org