Re: Getting upload/download size fot HTTP_Request2
| From: | Alexey Borzov | Date: | Thu, 27 Nov 2008 16:30:02 +0000 |
| Subject: | Re: Getting upload/download size fot HTTP_Request2 | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-29455@lists.php.net to get a copy of this message | ||
Hi,
Michael Gauthier wrote:
How does one get the number of bytes uploaded and downloaded using the new HTTP_Request2 package? I can't find it in the docs.You can get the size of the request body by attaching an Observer to the request object and getting the Content-Length header from data for 'sentHeaders' event. As for response body length, your options are basically limited to strlen($response->getBody()) since it is impossible to know the length before receiving complete body when 'Transfer-Encoding: chunked' is used.