bsb-http-chunked- Chunked HTTP transfer encoding for bytestring builders

Safe HaskellNone



HTTP/1.1 chunked transfer encoding as defined in RFC 7230 Section 4.1



chunkedTransferEncoding :: Builder -> Builder Source #

Transform a builder such that it uses chunked HTTP transfer encoding.

>>> :set -XOverloadedStrings
>>> import Data.ByteString.Builder as B
>>> let f = B.toLazyByteString . chunkedTransferEncoding . B.lazyByteString
>>> f "data"
>>> f ""

Note: While for many inputs, the bytestring chunks that can be obtained from the output via toChunks . toLazyByteString each form a chunk in the sense of RFC 7230 Section 4.1, this correspondence doesn't hold in general.

chunkedTransferTerminator :: Builder Source #

The zero-length chunk 0\r\n\r\n signalling the termination of the data transfer.