[web-devel] Any examples of using RequestBodyBuilder from http-enumerator

Michael Snoyman michael at snoyman.com
Fri Dec 9 07:27:53 CET 2011


On Fri, Dec 9, 2011 at 5:50 AM, Erik de Castro Lopo
<mle+hs at mega-nerd.com> wrote:
> Hi all,
>
> I'm a bit stumped on how to use the RequestBodyBuilder constructor:
>
>   http://hackage.haskell.org/packages/archive/http-enumerator/latest/doc/html/Network-HTTP-Enumerator.html#t:RequestBody
>
> Is anyone able to point me at some code that uses this?
>
> Cheers,
> Erik
> --
> ----------------------------------------------------------------------
> Erik de Castro Lopo
> http://www.mega-nerd.com/
>
> _______________________________________________
> web-devel mailing list
> web-devel at haskell.org
> http://www.haskell.org/mailman/listinfo/web-devel

No examples, sorry, but the idea is to provide a Builder instead of a
ByteString, so that you can cheaply concatenate together smaller
pieces and avoid a potentially costly length operation *if* you know
the ultimate size of the body. You could consider the following to be
equivalent:

    RequestBodyBS bs ~== RequstBodyBuilder (S.length bs) (fromByteString bs)

HTH,
Michael



More information about the web-devel mailing list