progress
- Summary
Defines a function to invoke when transfer progress is made.- Types
-
callable
- Default
None- Constant
GuzzleHttp\RequestOptions::PROGRESS
The function accepts the following positional arguments:
the total number of bytes expected to be downloaded
- // Send a GET request to /get?foo=bar
- $result = $client->request(
- 'GET',
- '/',
- [
- 'progress' => function(
- $downloadTotal,
- $downloadedBytes,
- $uploadTotal,
- $uploadedBytes
- ) {
- //do something
- },
- ]
- );