X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=http%2FMessage%2FBody%2FtoCallback.md;fp=http%2FMessage%2FBody%2FtoCallback.md;h=dab219a1d2620d72569121846f3531fc0efde21c;hb=b58f881f1bfba679372b1cf51d14228a00ab22d1;hp=0000000000000000000000000000000000000000;hpb=df8a4af106ea7a1f64eb2f0d99883b6e182e720b;p=mdref%2Fmdref-http diff --git a/http/Message/Body/toCallback.md b/http/Message/Body/toCallback.md new file mode 100644 index 0000000..dab219a --- /dev/null +++ b/http/Message/Body/toCallback.md @@ -0,0 +1,16 @@ +# http\Message\Body http\Message\Body::toCallback(callable $callback[, int $offset = 0[, int $maxlen = 0]]) + +Stream the message body through a callback. + +## Params: + +* callable $callback + The callback of the form function(http\MessageBody $from, string $data). +* Optional int $offset = 0 + Start to stream from this offset. +* Optional int $maxlen = 0 + Stream at most $maxlen bytes, or all if $maxlen is less than 1. + +## Returns: + +* http\Message\Body, self.