- Reference manual
HTTP protocol provides for transfer encodings. These define
filters applied to the data described by the
The two most popular transfer encodings are
chunked encoding avoids the need
Content-length header, sending the data in chunks,
each of which is preceded by a length. The
Transfer-encodings are supported by filters defined as foreign
libraries that realise an encoding/decoding stream on top of another
stream. Currently there are two such libraries:
There is an emerging hook interface dealing with transfer encodings.
library(http/http_chunked.pl) provides a hook used by
library(http/http_open.pl) to support chunked encoding in http_open/3.
Note that both
must be loaded for http_open/3
to support chunked encoding.
- http_chunked_open(+RawStream, -DataStream, +Options)
- Create a stream to realise HTTP chunked encoding or decoding. The technique is similar to library(zlib), using a Prolog stream as a filter on another stream. See online documentation at http://www.swi-prolog.org/ for details.