----- Original Message -----

> From: "Oleg Kalnichevski" <[email protected]>
> To: "HttpComponents Project" <[email protected]>
> Sent: Wednesday, August 3, 2011 10:40:54 AM
> Subject: Re: HttpAsyncPut constructor issue

> On Wed, 2011-08-03 at 10:16 -0500, Jon Brisbin wrote:
> > I'm building a proof of concept application that uses the async
> > HTTP client and I've hit a snag w.r.t. the API. I'm streaming
> > content using PUT and I don't have any content to pass to the
> > constructor. Is it safe to pass null here?

> No, it is not. Why would you want to issue a PUT request without any
> content in the first place?

Because I'm writing a non-blocking application that uses a PUT REST API call. I 
start a PUT request when I have the first bit of data I need then I send the 
rest of the content as I get it. 

> > I need to send content in chunks because it's impossible to do it
> > by loading the (possibly huge) files into a byte[] in memory.
> >
> > How do I do streaming with a PUT using the async HTTP client?
> >

> You can either use the ZeroCopyPut request producer if the request
> content is stored in a file or builds a custom implementation of
> HttpAsyncRequestProducer that generates bits of content dynamically
> and
> writes them out using the #produceContent method.
Looks like I'll need to create a custom ZeroCopyPut that doesn't use a File. 

Thanks for the help. 

jb 

> Hope this helps

> Oleg

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]

Reply via email to