[drakma-devel] Sending content without loading it all in memory?

Edi Weitz edi at agharta.de
Wed Sep 10 15:03:33 UTC 2008


On Wed, 10 Sep 2008 09:20:30 -0400, Zach Beane <xach at xach.com> wrote:

> Is there any way to send a non-chunked request without having the
> entire content in memory at once?

You can set the content length header yourself.  In that case Drakma
shouldn't use chunked encoding IIRC.

  http://weitz.de/drakma/#content-length

> I'm working on an Amazon S3 client based on Drakma, but sometimes I
> want to upload (via PUT) very large files and I'd prefer to
> determine the content-length via FILE-LENGTH and upload the body
> buffer-by-buffer instead of all at once.

That should be no problem if you provide a function as the :content
keyword argument or use the "continuation" facility.

Cheers,
Edi.



More information about the Drakma-devel mailing list