Python http chunked encoding and decoding library
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
chunks
tests/unit
.gitignore
README.md
setup.py

README.md

>>> import chunks
>>> from StringIO import StringIO

>>> decoded = StringIO()

>>> input = """25\r\nThis is the data in the first chunk\r\n\r\n1C\r\nand this is the second one\r\n\r\n3\r\ncon\r\n8\r\nsequence\r\n0\r\n\r\n"""

>>> for chunk in chunks.decode(StringIO(input)):
>>>     decoded.write(chunk)

>>> decoded.seek(0)
>>> print decoded.getvalue()
This is the data in the first chunk
and this is the second one
consequence