fc48ffe6a0c56a5b6cf4901312c58d1e91d3cf0b
[mdref/mdref-http] / http / Message / toCallback.md
1 # http\Message http\Message::toCallback(callable $callback[, int $offset = 0[, int $maxlen = 0]])
2
3 Stream the message through a callback.
4
5 ## Params:
6
7 * callable $callback
8 The callback of the form function(http\Message $from, string $data).
9 * Optional int $offset = 0
10 Start to stream from this offset.
11 * Optional int $maxlen = 0
12 Stream at most $maxlen bytes, or all if $maxlen is less than 1.
13
14 ## Returns:
15
16 * http\Message, self.