message
[mdref/mdref-http] / http / Message / Body / toCallback.md
1 # http\Message\Body http\Message\Body::toCallback(callable $callback[, int $offset = 0[, int $maxlen = 0]])
2
3 Stream the message body through a callback.
4
5 ## Params:
6
7 * callable $callback
8 The callback of the form function(http\Message\Body $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\Body, self.