I just found found out the answer to my related question -how to access raw bytes asynchronously. One can use org.apache.http.nio.client.methods.AsyncByteConsumer
On Fri, Jan 10, 2014 at 12:49 PM, Gaurav Kumar <[email protected]>wrote: > I went through the > examples<http://hc.apache.org/httpcomponents-asyncclient-dev/examples.html> > but > couldn't find a simple way to asynchronously read response status and > headers. > This<http://hc.apache.org/httpcomponents-asyncclient-dev/httpasyncclient/examples/org/apache/http/examples/nio/client/AsyncClientConfiguration.java> > example > shows how to use responseParserFactory but I think it is too complex for > my need. I just need a simple callback something like onHeadersReceive(), > onStatusReceive() and onBodyReceive(). > > > On a related note, > this<http://hc.apache.org/httpcomponents-asyncclient-dev/httpasyncclient/examples/org/apache/http/examples/nio/client/AsyncClientHttpExchangeStreaming.java>example > is great for textual entities but how do I handle non-textual > entities. In other words, is there a simple way to get access to raw bytes > received asynchronously? > > Thanks, > Gaurav > >
