Full Code of guzzle/guzzle for AI

7.10 fb92d95f80a9 cached
110 files
768.6 KB
193.8k tokens
760 symbols
1 requests
Download .txt
Showing preview only (805K chars total). Download the full file or copy to clipboard to get everything.
Repository: guzzle/guzzle
Branch: 7.10
Commit: fb92d95f80a9
Files: 110
Total size: 768.6 KB

Directory structure:
gitextract_1_65s9f1/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── .editorconfig
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── stale.yml
│   └── workflows/
│       ├── checks.yml
│       ├── ci.yml
│       └── static.yml
├── .gitignore
├── .php-cs-fixer.dist.php
├── CHANGELOG.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── UPGRADING.md
├── composer.json
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── faq.rst
│   ├── handlers-and-middleware.rst
│   ├── index.rst
│   ├── overview.rst
│   ├── psr7.rst
│   ├── quickstart.rst
│   ├── request-options.rst
│   ├── requirements.txt
│   └── testing.rst
├── phpstan-baseline.neon
├── phpstan.neon.dist
├── phpunit.xml.dist
├── src/
│   ├── BodySummarizer.php
│   ├── BodySummarizerInterface.php
│   ├── Client.php
│   ├── ClientInterface.php
│   ├── ClientTrait.php
│   ├── Cookie/
│   │   ├── CookieJar.php
│   │   ├── CookieJarInterface.php
│   │   ├── FileCookieJar.php
│   │   ├── SessionCookieJar.php
│   │   └── SetCookie.php
│   ├── Exception/
│   │   ├── BadResponseException.php
│   │   ├── ClientException.php
│   │   ├── ConnectException.php
│   │   ├── GuzzleException.php
│   │   ├── InvalidArgumentException.php
│   │   ├── RequestException.php
│   │   ├── ServerException.php
│   │   ├── TooManyRedirectsException.php
│   │   └── TransferException.php
│   ├── Handler/
│   │   ├── CurlFactory.php
│   │   ├── CurlFactoryInterface.php
│   │   ├── CurlHandler.php
│   │   ├── CurlMultiHandler.php
│   │   ├── EasyHandle.php
│   │   ├── HeaderProcessor.php
│   │   ├── MockHandler.php
│   │   ├── Proxy.php
│   │   └── StreamHandler.php
│   ├── HandlerStack.php
│   ├── MessageFormatter.php
│   ├── MessageFormatterInterface.php
│   ├── Middleware.php
│   ├── Pool.php
│   ├── PrepareBodyMiddleware.php
│   ├── RedirectMiddleware.php
│   ├── RequestOptions.php
│   ├── RetryMiddleware.php
│   ├── TransferStats.php
│   ├── Utils.php
│   ├── functions.php
│   └── functions_include.php
├── tests/
│   ├── ClientTest.php
│   ├── Cookie/
│   │   ├── CookieJarTest.php
│   │   ├── FileCookieJarTest.php
│   │   ├── SessionCookieJarTest.php
│   │   └── SetCookieTest.php
│   ├── Exception/
│   │   ├── BadResponseExceptionTest.php
│   │   ├── ConnectExceptionTest.php
│   │   └── RequestExceptionTest.php
│   ├── Handler/
│   │   ├── CurlFactoryTest.php
│   │   ├── CurlHandlerTest.php
│   │   ├── CurlMultiHandlerTest.php
│   │   ├── EasyHandleTest.php
│   │   ├── MockHandlerTest.php
│   │   ├── Network/
│   │   │   └── StreamHandlerTest.php
│   │   ├── ProxyTest.php
│   │   └── StreamHandlerTest.php
│   ├── HandlerStackTest.php
│   ├── Helpers.php
│   ├── HttplugIntegrationTest.php
│   ├── InternalUtilsTest.php
│   ├── MessageFormatterTest.php
│   ├── MiddlewareTest.php
│   ├── PoolTest.php
│   ├── PrepareBodyMiddlewareTest.php
│   ├── RedirectMiddlewareTest.php
│   ├── RetryMiddlewareTest.php
│   ├── Server.php
│   ├── TestLogger.php
│   ├── TransferStatsTest.php
│   ├── UtilsTest.php
│   ├── bootstrap-phpstan.php
│   ├── bootstrap.php
│   └── server.js
└── vendor-bin/
    ├── php-cs-fixer/
    │   └── composer.json
    └── phpstan/
        └── composer.json

================================================
FILE CONTENTS
================================================

================================================
FILE: .editorconfig
================================================
# EditorConfig is awesome: https://editorconfig.org/

# top-most EditorConfig file
root = true

# Unix-style newlines with a newline ending for every file
# Indent with 4 spaces
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[Makefile]
indent_style = tab


================================================
FILE: .gitattributes
================================================
.editorconfig          export-ignore
.gitattributes         export-ignore
/.github/              export-ignore
.gitignore             export-ignore
.php-cs-fixer.dist.php export-ignore
/docs/                 export-ignore
/Dockerfile            export-ignore
/Makefile              export-ignore
/phpstan-baseline.neon export-ignore
/phpstan.neon.dist     export-ignore
/phpunit.xml.dist      export-ignore
/psalm-baseline.xml    export-ignore
/psalm.xml             export-ignore
/tests/                export-ignore
/vendor-bin/           export-ignore


================================================
FILE: .github/.editorconfig
================================================
[*.yml]
indent_size = 2


================================================
FILE: .github/FUNDING.yml
================================================
github: [Nyholm, GrahamCampbell]
tidelift: "packagist/guzzlehttp/guzzle"


================================================
FILE: .github/ISSUE_TEMPLATE/bug_report.md
================================================
---
name: 🐛 Bug Report
about: Report errors and problems
---

**Guzzle version(s) affected**: x.y.z
**PHP version**: x.y.z (hint: `php --version`)
**cURL version**: x.y.z (hint: `php -i | grep cURL`)

**Description**  
<!-- A clear and concise description of the problem. -->

**How to reproduce**  
<!-- Code and/or config needed to reproduce the problem. -->

**Possible Solution**  
<!--- Optional: only if you have suggestions on a fix/reason for the bug -->

**Additional context**  
<!-- Optional: any other context about the problem: log messages, screenshots, etc. -->


================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: false
contact_links:
  - name: 📚Documentation
    url: https://docs.guzzlephp.org/en/stable/
    about: Check the documentation before opening an issue.

  - name: ❓Support
    url: https://github.com/guzzle/.github/blob/master/.github/SUPPORT.md
    about: We use GitHub issues only to discuss bugs and new features.


================================================
FILE: .github/ISSUE_TEMPLATE/feature_request.md
================================================
---
name: 🚀 Feature Request
about: RFC and ideas for new features and improvements
---

**Description**
<!-- A clear and concise description of the new feature. -->

**Example**
<!-- A simple example of the new feature in action (include PHP code, YAML config, etc.)
     If the new feature changes an existing feature, include a simple before/after comparison. -->

**Additional context**
<!-- Add any other context or screenshots about the feature request here. -->


================================================
FILE: .github/stale.yml
================================================
daysUntilStale: 120
daysUntilClose: 14
exemptLabels:
  - lifecycle/keep-open
  - lifecycle/ready-for-merge
# Label to use when marking an issue as stale
staleLabel: lifecycle/stale
# Comment to post when marking an issue as stale. Set to `false` to disable
markComment: >
  This issue has been automatically marked as stale because it has not had
  recent activity. It will be closed after 2 weeks if no further activity occurs. Thank you
  for your contributions.
# Comment to post when closing a stale issue. Set to `false` to disable
closeComment: false


================================================
FILE: .github/workflows/checks.yml
================================================
name: Checks

on:
  push:
    branches:
  pull_request:

permissions:
  contents: read

jobs:
  composer-normalize:
    name: Composer Normalize
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Composer normalize
        uses: docker://ergebnis/composer-normalize-action


================================================
FILE: .github/workflows/ci.yml
================================================
name: CI

on:
  push:
    branches:
  pull_request:

permissions:
  contents: read

jobs:
  build-lowest-version:
    name: Build lowest version
    runs-on: ubuntu-24.04

    steps:
      - name: Set up PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.2'
          ini-values: error_reporting=E_ALL
          coverage: none
          extensions: mbstring, intl

      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: '18.x'

      - name: Setup Problem Matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Checkout code
        uses: actions/checkout@v6

      - name: Download dependencies
        run: composer update --no-interaction --no-progress --prefer-stable --prefer-lowest

      - name: Start test servers
        shell: bash
        run: |
          node tests/server.js &
          ./vendor/bin/http_test_server &

      - name: Run tests
        run: ./vendor/bin/phpunit

  build:
    name: Build
    runs-on: ubuntu-24.04
    strategy:
      fail-fast: false
      max-parallel: 10
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']
        psr7: ['^2.8']
        include:
          - php: '8.5'
            psr7: '^2.8@dev'

    steps:
      - name: Set up PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          ini-values: error_reporting=E_ALL
          coverage: none
          extensions: mbstring, intl

      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: '18.x'

      - name: Setup Problem Matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Checkout code
        uses: actions/checkout@v6

      - name: Download dependencies
        run: |
          composer require --no-update "guzzlehttp/psr7:${{ matrix.psr7 }}"
          composer update --no-interaction --no-progress

      - name: Start test servers
        shell: bash
        run: |
          node tests/server.js &
          ./vendor/bin/http_test_server &

      - name: Run tests
        run: ./vendor/bin/phpunit

  build-windows:
    name: Build on Windows
    runs-on: windows-2025
    strategy:
      fail-fast: false
      max-parallel: 10
      matrix:
        php: ['7.2', '7.3', '7.4', '8.0', '8.1', '8.2', '8.3', '8.4', '8.5']

    steps:
      - name: Set up PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: ${{ matrix.php }}
          ini-values: error_reporting=E_ALL
          coverage: none
          extensions: mbstring, intl

      - name: Set up Node
        uses: actions/setup-node@v3
        with:
          node-version: '18.x'

      - name: Setup Problem Matchers for PHPUnit
        run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

      - name: Checkout code
        uses: actions/checkout@v6

      - name: Download dependencies
        run: composer update --no-interaction --no-progress

      - name: Start test servers
        shell: bash
        run: |
          node tests/server.js &
          ./vendor/bin/http_test_server &

      - name: Run tests
        run: vendor/bin/phpunit.bat


================================================
FILE: .github/workflows/static.yml
================================================
name: Static analysis

on:
  push:
    branches:
  pull_request:

permissions:
  contents: read

jobs:
  phpstan:
    name: PHPStan
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '8.5'
          coverage: none
          extensions: mbstring, intl

      - name: Download dependencies
        run: composer update --no-interaction --no-progress

      - name: Download PHPStan
        run: composer bin phpstan update --no-interaction --no-progress

      - name: Execute PHPStan
        run: vendor/bin/phpstan analyze --no-progress

  php-cs-fixer:
    name: PHP-CS-Fixer
    runs-on: ubuntu-24.04

    steps:
      - name: Checkout code
        uses: actions/checkout@v6

      - name: Setup PHP
        uses: shivammathur/setup-php@v2
        with:
          php-version: '7.4'
          coverage: none
          extensions: mbstring

      - name: Download dependencies
        run: composer update --no-interaction --no-progress

      - name: Download PHP CS Fixer
        run: composer bin php-cs-fixer update --no-interaction --no-progress

      - name: Execute PHP CS Fixer
        run: vendor/bin/php-cs-fixer fix --diff --dry-run


================================================
FILE: .gitignore
================================================
.php-cs-fixer.php
.php-cs-fixer.cache
.phpunit.result.cache
composer.lock
vendor/
/phpstan.neon
/phpunit.xml

build/
artifacts/
docs/_build
docs/*.pyc


================================================
FILE: .php-cs-fixer.dist.php
================================================
<?php

$config = (new PhpCsFixer\Config())
    ->setRiskyAllowed(true)
    ->setRules([
        '@PHP71Migration:risky' => true,
        '@PHPUnit75Migration:risky' => true,
        '@PSR12:risky' => true,
        '@Symfony' => true,
        'declare_strict_types' => false,
        'global_namespace_import' => false,
        'no_superfluous_phpdoc_tags' => [
            'allow_mixed' => true,
        ],
        'phpdoc_annotation_without_dot' => false,
        'phpdoc_summary' => false,
        'phpdoc_to_comment' => false,
        'single_line_throw' => false,
        'void_return' => false,
        'yoda_style' => false,
    ])
    ->setFinder(
        PhpCsFixer\Finder::create()
            ->in(__DIR__.'/src')
            ->in(__DIR__.'/tests')
            ->name('*.php')
    )
;

return $config;


================================================
FILE: CHANGELOG.md
================================================
# Change Log

Please refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.

## 7.10.0 - 2025-08-23

### Added

- Support for PHP 8.5

### Changed

- Adjusted `guzzlehttp/promises` version constraint to `^2.3`
- Adjusted `guzzlehttp/psr7` version constraint to `^2.8`


## 7.9.3 - 2025-03-27

### Changed

- Remove explicit content-length header for GET requests
- Improve compatibility with bad servers for boolean cookie values


## 7.9.2 - 2024-07-24

### Fixed

- Adjusted handler selection to use cURL if its version is 7.21.2 or higher, rather than 7.34.0


## 7.9.1 - 2024-07-19

### Fixed

- Fix TLS 1.3 check for HTTP/2 requests


## 7.9.0 - 2024-07-18

### Changed

- Improve protocol version checks to provide feedback around unsupported protocols
- Only select the cURL handler by default if 7.34.0 or higher is linked
- Improved `CurlMultiHandler` to avoid busy wait if possible
- Dropped support for EOL `guzzlehttp/psr7` v1
- Improved URI user info redaction in errors

## 7.8.2 - 2024-07-18

### Added

- Support for PHP 8.4


## 7.8.1 - 2023-12-03

### Changed

- Updated links in docs to their canonical versions
- Replaced `call_user_func*` with native calls


## 7.8.0 - 2023-08-27

### Added

- Support for PHP 8.3
- Added automatic closing of handles on `CurlFactory` object destruction


## 7.7.1 - 2023-08-27

### Changed

- Remove the need for `AllowDynamicProperties` in `CurlMultiHandler`


## 7.7.0 - 2023-05-21

### Added

- Support `guzzlehttp/promises` v2


## 7.6.1 - 2023-05-15

### Fixed

- Fix `SetCookie::fromString` MaxAge deprecation warning and skip invalid MaxAge values


## 7.6.0 - 2023-05-14

### Added

- Support for setting the minimum TLS version in a unified way
- Apply on request the version set in options parameters


## 7.5.2 - 2023-05-14

### Fixed

- Fixed set cookie constructor validation
- Fixed handling of files with `'0'` body

### Changed

- Corrected docs and default connect timeout value to 300 seconds


## 7.5.1 - 2023-04-17

### Fixed

- Fixed `NO_PROXY` settings so that setting the `proxy` option to `no` overrides the env variable

### Changed

- Adjusted `guzzlehttp/psr7` version constraint to `^1.9.1 || ^2.4.5`


## 7.5.0 - 2022-08-28

### Added

- Support PHP 8.2
- Add request to delay closure params


## 7.4.5 - 2022-06-20

### Fixed

* Fix change in port should be considered a change in origin
* Fix `CURLOPT_HTTPAUTH` option not cleared on change of origin


## 7.4.4 - 2022-06-09

### Fixed

* Fix failure to strip Authorization header on HTTP downgrade
* Fix failure to strip the Cookie header on change in host or HTTP downgrade


## 7.4.3 - 2022-05-25

### Fixed

* Fix cross-domain cookie leakage


## 7.4.2 - 2022-03-20

### Fixed

- Remove curl auth on cross-domain redirects to align with the Authorization HTTP header
- Reject non-HTTP schemes in StreamHandler
- Set a default ssl.peer_name context in StreamHandler to allow `force_ip_resolve`


## 7.4.1 - 2021-12-06

### Changed

- Replaced implicit URI to string coercion [#2946](https://github.com/guzzle/guzzle/pull/2946)
- Allow `symfony/deprecation-contracts` version 3 [#2961](https://github.com/guzzle/guzzle/pull/2961)

### Fixed

- Only close curl handle if it's done [#2950](https://github.com/guzzle/guzzle/pull/2950)


## 7.4.0 - 2021-10-18

### Added

- Support PHP 8.1 [#2929](https://github.com/guzzle/guzzle/pull/2929), [#2939](https://github.com/guzzle/guzzle/pull/2939)
- Support `psr/log` version 2 and 3 [#2943](https://github.com/guzzle/guzzle/pull/2943)

### Fixed

- Make sure we always call `restore_error_handler()` [#2915](https://github.com/guzzle/guzzle/pull/2915)
- Fix progress parameter type compatibility between the cURL and stream handlers [#2936](https://github.com/guzzle/guzzle/pull/2936)
- Throw `InvalidArgumentException` when an incorrect `headers` array is provided [#2916](https://github.com/guzzle/guzzle/pull/2916), [#2942](https://github.com/guzzle/guzzle/pull/2942)

### Changed

- Be more strict with types [#2914](https://github.com/guzzle/guzzle/pull/2914), [#2917](https://github.com/guzzle/guzzle/pull/2917), [#2919](https://github.com/guzzle/guzzle/pull/2919), [#2945](https://github.com/guzzle/guzzle/pull/2945)


## 7.3.0 - 2021-03-23

### Added

- Support for DER and P12 certificates [#2413](https://github.com/guzzle/guzzle/pull/2413)
- Support the cURL (http://) scheme for StreamHandler proxies [#2850](https://github.com/guzzle/guzzle/pull/2850)
- Support for `guzzlehttp/psr7:^2.0` [#2878](https://github.com/guzzle/guzzle/pull/2878)

### Fixed

- Handle exceptions on invalid header consistently between PHP versions and handlers [#2872](https://github.com/guzzle/guzzle/pull/2872)


## 7.2.0 - 2020-10-10

### Added

- Support for PHP 8 [#2712](https://github.com/guzzle/guzzle/pull/2712), [#2715](https://github.com/guzzle/guzzle/pull/2715), [#2789](https://github.com/guzzle/guzzle/pull/2789)
- Support passing a body summarizer to the http errors middleware [#2795](https://github.com/guzzle/guzzle/pull/2795)

### Fixed

- Handle exceptions during response creation [#2591](https://github.com/guzzle/guzzle/pull/2591)
- Fix CURLOPT_ENCODING not to be overwritten [#2595](https://github.com/guzzle/guzzle/pull/2595)
- Make sure the Request always has a body object [#2804](https://github.com/guzzle/guzzle/pull/2804)

### Changed

- The `TooManyRedirectsException` has a response [#2660](https://github.com/guzzle/guzzle/pull/2660)
- Avoid "functions" from dependencies [#2712](https://github.com/guzzle/guzzle/pull/2712)

### Deprecated

- Using environment variable GUZZLE_CURL_SELECT_TIMEOUT [#2786](https://github.com/guzzle/guzzle/pull/2786)


## 7.1.1 - 2020-09-30

### Fixed

- Incorrect EOF detection for response body streams on Windows.

### Changed

- We dont connect curl `sink` on HEAD requests.
- Removed some PHP 5 workarounds


## 7.1.0 - 2020-09-22

### Added

- `GuzzleHttp\MessageFormatterInterface`

### Fixed

- Fixed issue that caused cookies with no value not to be stored.
- On redirects, we allow all safe methods like GET, HEAD and OPTIONS.
- Fixed logging on empty responses.
- Make sure MessageFormatter::format returns string

### Deprecated

- All functions in `GuzzleHttp` has been deprecated. Use static methods on `Utils` instead.
- `ClientInterface::getConfig()`
- `Client::getConfig()`
- `Client::__call()`
- `Utils::defaultCaBundle()`
- `CurlFactory::LOW_CURL_VERSION_NUMBER`


## 7.0.1 - 2020-06-27

* Fix multiply defined functions fatal error [#2699](https://github.com/guzzle/guzzle/pull/2699)


## 7.0.0 - 2020-06-27

No changes since 7.0.0-rc1.


## 7.0.0-rc1 - 2020-06-15

### Changed

* Use error level for logging errors in Middleware [#2629](https://github.com/guzzle/guzzle/pull/2629)
* Disabled IDN support by default and require ext-intl to use it [#2675](https://github.com/guzzle/guzzle/pull/2675)


## 7.0.0-beta2 - 2020-05-25

### Added

* Using `Utils` class instead of functions in the `GuzzleHttp` namespace. [#2546](https://github.com/guzzle/guzzle/pull/2546)
* `ClientInterface::MAJOR_VERSION` [#2583](https://github.com/guzzle/guzzle/pull/2583)

### Changed

* Avoid the `getenv` function when unsafe [#2531](https://github.com/guzzle/guzzle/pull/2531)
* Added real client methods [#2529](https://github.com/guzzle/guzzle/pull/2529)
* Avoid functions due to global install conflicts [#2546](https://github.com/guzzle/guzzle/pull/2546)
* Use Symfony intl-idn polyfill [#2550](https://github.com/guzzle/guzzle/pull/2550)
* Adding methods for HTTP verbs like `Client::get()`, `Client::head()`, `Client::patch()` etc [#2529](https://github.com/guzzle/guzzle/pull/2529)
* `ConnectException` extends `TransferException` [#2541](https://github.com/guzzle/guzzle/pull/2541)
* Updated the default User Agent to "GuzzleHttp/7" [#2654](https://github.com/guzzle/guzzle/pull/2654)

### Fixed

* Various intl icu issues [#2626](https://github.com/guzzle/guzzle/pull/2626)

### Removed

* Pool option `pool_size` [#2528](https://github.com/guzzle/guzzle/pull/2528)


## 7.0.0-beta1 - 2019-12-30

The diff might look very big but 95% of Guzzle users will be able to upgrade without modification.
Please see [the upgrade document](UPGRADING.md) that describes all BC breaking changes.

### Added

* Implement PSR-18 and dropped PHP 5 support [#2421](https://github.com/guzzle/guzzle/pull/2421) [#2474](https://github.com/guzzle/guzzle/pull/2474)
* PHP 7 types [#2442](https://github.com/guzzle/guzzle/pull/2442) [#2449](https://github.com/guzzle/guzzle/pull/2449) [#2466](https://github.com/guzzle/guzzle/pull/2466) [#2497](https://github.com/guzzle/guzzle/pull/2497) [#2499](https://github.com/guzzle/guzzle/pull/2499)
* IDN support for redirects [2424](https://github.com/guzzle/guzzle/pull/2424)

### Changed

* Dont allow passing null as third argument to `BadResponseException::__construct()` [#2427](https://github.com/guzzle/guzzle/pull/2427)
* Use SAPI constant instead of method call [#2450](https://github.com/guzzle/guzzle/pull/2450)
* Use native function invocation [#2444](https://github.com/guzzle/guzzle/pull/2444)
* Better defaults for PHP installations with old ICU lib [2454](https://github.com/guzzle/guzzle/pull/2454)
* Added visibility to all constants [#2462](https://github.com/guzzle/guzzle/pull/2462)
* Dont allow passing `null` as URI to `Client::request()` and `Client::requestAsync()` [#2461](https://github.com/guzzle/guzzle/pull/2461)
* Widen the exception argument to throwable [#2495](https://github.com/guzzle/guzzle/pull/2495)

### Fixed

* Logging when Promise rejected with a string [#2311](https://github.com/guzzle/guzzle/pull/2311)

### Removed

* Class `SeekException` [#2162](https://github.com/guzzle/guzzle/pull/2162)
* `RequestException::getResponseBodySummary()` [#2425](https://github.com/guzzle/guzzle/pull/2425)
* `CookieJar::getCookieValue()` [#2433](https://github.com/guzzle/guzzle/pull/2433)
* `uri_template()` and `UriTemplate` [#2440](https://github.com/guzzle/guzzle/pull/2440)
* Request options `save_to` and `exceptions` [#2464](https://github.com/guzzle/guzzle/pull/2464)


## 6.5.2 - 2019-12-23

* idn_to_ascii() fix for old PHP versions [#2489](https://github.com/guzzle/guzzle/pull/2489)


## 6.5.1 - 2019-12-21

* Better defaults for PHP installations with old ICU lib [#2454](https://github.com/guzzle/guzzle/pull/2454)
* IDN support for redirects [#2424](https://github.com/guzzle/guzzle/pull/2424)


## 6.5.0 - 2019-12-07

* Improvement: Added support for reset internal queue in MockHandler. [#2143](https://github.com/guzzle/guzzle/pull/2143)
* Improvement: Added support to pass arbitrary options to `curl_multi_init`. [#2287](https://github.com/guzzle/guzzle/pull/2287)
* Fix: Gracefully handle passing `null` to the `header` option. [#2132](https://github.com/guzzle/guzzle/pull/2132)
* Fix: `RetryMiddleware` did not do exponential delay between retires due unit mismatch. [#2132](https://github.com/guzzle/guzzle/pull/2132)
* Fix: Prevent undefined offset when using array for ssl_key options. [#2348](https://github.com/guzzle/guzzle/pull/2348)
* Deprecated `ClientInterface::VERSION`


## 6.4.1 - 2019-10-23

* No `guzzle.phar` was created in 6.4.0 due expired API token. This release will fix that
* Added `parent::__construct()` to `FileCookieJar` and `SessionCookieJar`


## 6.4.0 - 2019-10-23

* Improvement: Improved error messages when using curl < 7.21.2 [#2108](https://github.com/guzzle/guzzle/pull/2108)
* Fix: Test if response is readable before returning a summary in `RequestException::getResponseBodySummary()` [#2081](https://github.com/guzzle/guzzle/pull/2081)
* Fix: Add support for GUZZLE_CURL_SELECT_TIMEOUT environment variable [#2161](https://github.com/guzzle/guzzle/pull/2161)
* Improvement: Added `GuzzleHttp\Exception\InvalidArgumentException` [#2163](https://github.com/guzzle/guzzle/pull/2163)
* Improvement: Added `GuzzleHttp\_current_time()` to use `hrtime()` if that function exists. [#2242](https://github.com/guzzle/guzzle/pull/2242)
* Improvement: Added curl's `appconnect_time` in `TransferStats` [#2284](https://github.com/guzzle/guzzle/pull/2284)
* Improvement: Make GuzzleException extend Throwable wherever it's available [#2273](https://github.com/guzzle/guzzle/pull/2273)
* Fix: Prevent concurrent writes to file when saving `CookieJar` [#2335](https://github.com/guzzle/guzzle/pull/2335)
* Improvement: Update `MockHandler` so we can test transfer time [#2362](https://github.com/guzzle/guzzle/pull/2362)


## 6.3.3 - 2018-04-22

* Fix: Default headers when decode_content is specified


## 6.3.2 - 2018-03-26

* Fix: Release process


## 6.3.1 - 2018-03-26

* Bug fix: Parsing 0 epoch expiry times in cookies [#2014](https://github.com/guzzle/guzzle/pull/2014)
* Improvement: Better ConnectException detection [#2012](https://github.com/guzzle/guzzle/pull/2012)
* Bug fix: Malformed domain that contains a "/" [#1999](https://github.com/guzzle/guzzle/pull/1999)
* Bug fix: Undefined offset when a cookie has no first key-value pair [#1998](https://github.com/guzzle/guzzle/pull/1998)
* Improvement: Support PHPUnit 6 [#1953](https://github.com/guzzle/guzzle/pull/1953)
* Bug fix: Support empty headers [#1915](https://github.com/guzzle/guzzle/pull/1915)
* Bug fix: Ignore case during header modifications [#1916](https://github.com/guzzle/guzzle/pull/1916)

+ Minor code cleanups, documentation fixes and clarifications.


## 6.3.0 - 2017-06-22

* Feature: force IP resolution (ipv4 or ipv6) [#1608](https://github.com/guzzle/guzzle/pull/1608), [#1659](https://github.com/guzzle/guzzle/pull/1659)
* Improvement: Don't include summary in exception message when body is empty [#1621](https://github.com/guzzle/guzzle/pull/1621)
* Improvement: Handle `on_headers` option in MockHandler [#1580](https://github.com/guzzle/guzzle/pull/1580)
* Improvement: Added SUSE Linux CA path [#1609](https://github.com/guzzle/guzzle/issues/1609)
* Improvement: Use class reference for getting the name of the class instead of using hardcoded strings [#1641](https://github.com/guzzle/guzzle/pull/1641)
* Feature: Added `read_timeout` option [#1611](https://github.com/guzzle/guzzle/pull/1611)
* Bug fix: PHP 7.x fixes [#1685](https://github.com/guzzle/guzzle/pull/1685), [#1686](https://github.com/guzzle/guzzle/pull/1686), [#1811](https://github.com/guzzle/guzzle/pull/1811)
* Deprecation: BadResponseException instantiation without a response [#1642](https://github.com/guzzle/guzzle/pull/1642)
* Feature: Added NTLM auth [#1569](https://github.com/guzzle/guzzle/pull/1569)
* Feature: Track redirect HTTP status codes [#1711](https://github.com/guzzle/guzzle/pull/1711)
* Improvement: Check handler type during construction [#1745](https://github.com/guzzle/guzzle/pull/1745)
* Improvement: Always include the Content-Length if there's a body [#1721](https://github.com/guzzle/guzzle/pull/1721)
* Feature: Added convenience method to access a cookie by name [#1318](https://github.com/guzzle/guzzle/pull/1318)
* Bug fix: Fill `CURLOPT_CAPATH` and `CURLOPT_CAINFO` properly [#1684](https://github.com/guzzle/guzzle/pull/1684)
* Improvement:  	Use `\GuzzleHttp\Promise\rejection_for` function instead of object init [#1827](https://github.com/guzzle/guzzle/pull/1827)

+ Minor code cleanups, documentation fixes and clarifications.


## 6.2.3 - 2017-02-28

* Fix deprecations with guzzle/psr7 version 1.4


## 6.2.2 - 2016-10-08

* Allow to pass nullable Response to delay callable
* Only add scheme when host is present
* Fix drain case where content-length is the literal string zero
* Obfuscate in-URL credentials in exceptions


## 6.2.1 - 2016-07-18

* Address HTTP_PROXY security vulnerability, CVE-2016-5385:
  https://httpoxy.org/
* Fixing timeout bug with StreamHandler:
  https://github.com/guzzle/guzzle/pull/1488
* Only read up to `Content-Length` in PHP StreamHandler to avoid timeouts when
  a server does not honor `Connection: close`.
* Ignore URI fragment when sending requests.


## 6.2.0 - 2016-03-21

* Feature: added `GuzzleHttp\json_encode` and `GuzzleHttp\json_decode`.
  https://github.com/guzzle/guzzle/pull/1389
* Bug fix: Fix sleep calculation when waiting for delayed requests.
  https://github.com/guzzle/guzzle/pull/1324
* Feature: More flexible history containers.
  https://github.com/guzzle/guzzle/pull/1373
* Bug fix: defer sink stream opening in StreamHandler.
  https://github.com/guzzle/guzzle/pull/1377
* Bug fix: do not attempt to escape cookie values.
  https://github.com/guzzle/guzzle/pull/1406
* Feature: report original content encoding and length on decoded responses.
  https://github.com/guzzle/guzzle/pull/1409
* Bug fix: rewind seekable request bodies before dispatching to cURL.
  https://github.com/guzzle/guzzle/pull/1422
* Bug fix: provide an empty string to `http_build_query` for HHVM workaround.
  https://github.com/guzzle/guzzle/pull/1367


## 6.1.1 - 2015-11-22

* Bug fix: Proxy::wrapSync() now correctly proxies to the appropriate handler
  https://github.com/guzzle/guzzle/commit/911bcbc8b434adce64e223a6d1d14e9a8f63e4e4
* Feature: HandlerStack is now more generic.
  https://github.com/guzzle/guzzle/commit/f2102941331cda544745eedd97fc8fd46e1ee33e
* Bug fix: setting verify to false in the StreamHandler now disables peer
  verification. https://github.com/guzzle/guzzle/issues/1256
* Feature: Middleware now uses an exception factory, including more error
  context. https://github.com/guzzle/guzzle/pull/1282
* Feature: better support for disabled functions.
  https://github.com/guzzle/guzzle/pull/1287
* Bug fix: fixed regression where MockHandler was not using `sink`.
  https://github.com/guzzle/guzzle/pull/1292


## 6.1.0 - 2015-09-08

* Feature: Added the `on_stats` request option to provide access to transfer
  statistics for requests. https://github.com/guzzle/guzzle/pull/1202
* Feature: Added the ability to persist session cookies in CookieJars.
  https://github.com/guzzle/guzzle/pull/1195
* Feature: Some compatibility updates for Google APP Engine
  https://github.com/guzzle/guzzle/pull/1216
* Feature: Added support for NO_PROXY to prevent the use of a proxy based on
  a simple set of rules. https://github.com/guzzle/guzzle/pull/1197
* Feature: Cookies can now contain square brackets.
  https://github.com/guzzle/guzzle/pull/1237
* Bug fix: Now correctly parsing `=` inside of quotes in Cookies.
  https://github.com/guzzle/guzzle/pull/1232
* Bug fix: Cusotm cURL options now correctly override curl options of the
  same name. https://github.com/guzzle/guzzle/pull/1221
* Bug fix: Content-Type header is now added when using an explicitly provided
  multipart body. https://github.com/guzzle/guzzle/pull/1218
* Bug fix: Now ignoring Set-Cookie headers that have no name.
* Bug fix: Reason phrase is no longer cast to an int in some cases in the
  cURL handler. https://github.com/guzzle/guzzle/pull/1187
* Bug fix: Remove the Authorization header when redirecting if the Host
  header changes. https://github.com/guzzle/guzzle/pull/1207
* Bug fix: Cookie path matching fixes
  https://github.com/guzzle/guzzle/issues/1129
* Bug fix: Fixing the cURL `body_as_string` setting
  https://github.com/guzzle/guzzle/pull/1201
* Bug fix: quotes are no longer stripped when parsing cookies.
  https://github.com/guzzle/guzzle/issues/1172
* Bug fix: `form_params` and `query` now always uses the `&` separator.
  https://github.com/guzzle/guzzle/pull/1163
* Bug fix: Adding a Content-Length to PHP stream wrapper requests if not set.
  https://github.com/guzzle/guzzle/pull/1189


## 6.0.2 - 2015-07-04

* Fixed a memory leak in the curl handlers in which references to callbacks
  were not being removed by `curl_reset`.
* Cookies are now extracted properly before redirects.
* Cookies now allow more character ranges.
* Decoded Content-Encoding responses are now modified to correctly reflect
  their state if the encoding was automatically removed by a handler. This
  means that the `Content-Encoding` header may be removed an the
  `Content-Length` modified to reflect the message size after removing the
  encoding.
* Added a more explicit error message when trying to use `form_params` and
  `multipart` in the same request.
* Several fixes for HHVM support.
* Functions are now conditionally required using an additional level of
  indirection to help with global Composer installations.


## 6.0.1 - 2015-05-27

* Fixed a bug with serializing the `query` request option where the `&`
  separator was missing.
* Added a better error message for when `body` is provided as an array. Please
  use `form_params` or `multipart` instead.
* Various doc fixes.


## 6.0.0 - 2015-05-26

* See the UPGRADING.md document for more information.
* Added `multipart` and `form_params` request options.
* Added `synchronous` request option.
* Added the `on_headers` request option.
* Fixed `expect` handling.
* No longer adding default middlewares in the client ctor. These need to be
  present on the provided handler in order to work.
* Requests are no longer initiated when sending async requests with the
  CurlMultiHandler. This prevents unexpected recursion from requests completing
  while ticking the cURL loop.
* Removed the semantics of setting `default` to `true`. This is no longer
  required now that the cURL loop is not ticked for async requests.
* Added request and response logging middleware.
* No longer allowing self signed certificates when using the StreamHandler.
* Ensuring that `sink` is valid if saving to a file.
* Request exceptions now include a "handler context" which provides handler
  specific contextual information.
* Added `GuzzleHttp\RequestOptions` to allow request options to be applied
  using constants.
* `$maxHandles` has been removed from CurlMultiHandler.
* `MultipartPostBody` is now part of the `guzzlehttp/psr7` package.


## 5.3.0 - 2015-05-19

* Mock now supports `save_to`
* Marked `AbstractRequestEvent::getTransaction()` as public.
* Fixed a bug in which multiple headers using different casing would overwrite
  previous headers in the associative array.
* Added `Utils::getDefaultHandler()`
* Marked `GuzzleHttp\Client::getDefaultUserAgent` as deprecated.
* URL scheme is now always lowercased.


## 6.0.0-beta.1

* Requires PHP >= 5.5
* Updated to use PSR-7
  * Requires immutable messages, which basically means an event based system
    owned by a request instance is no longer possible.
  * Utilizing the [Guzzle PSR-7 package](https://github.com/guzzle/psr7).
  * Removed the dependency on `guzzlehttp/streams`. These stream abstractions
    are available in the `guzzlehttp/psr7` package under the `GuzzleHttp\Psr7`
    namespace.
* Added middleware and handler system
  * Replaced the Guzzle event and subscriber system with a middleware system.
  * No longer depends on RingPHP, but rather places the HTTP handlers directly
    in Guzzle, operating on PSR-7 messages.
  * Retry logic is now encapsulated in `GuzzleHttp\Middleware::retry`, which
    means the `guzzlehttp/retry-subscriber` is now obsolete.
  * Mocking responses is now handled using `GuzzleHttp\Handler\MockHandler`.
* Asynchronous responses
  * No longer supports the `future` request option to send an async request.
    Instead, use one of the `*Async` methods of a client (e.g., `requestAsync`,
    `getAsync`, etc.).
  * Utilizing `GuzzleHttp\Promise` instead of React's promise library to avoid
    recursion required by chaining and forwarding react promises. See
    https://github.com/guzzle/promises
  * Added `requestAsync` and `sendAsync` to send request asynchronously.
  * Added magic methods for `getAsync()`, `postAsync()`, etc. to send requests
    asynchronously.
* Request options
  * POST and form updates
    * Added the `form_fields` and `form_files` request options.
    * Removed the `GuzzleHttp\Post` namespace.
    * The `body` request option no longer accepts an array for POST requests.
  * The `exceptions` request option has been deprecated in favor of the
    `http_errors` request options.
  * The `save_to` request option has been deprecated in favor of `sink` request
    option.
* Clients no longer accept an array of URI template string and variables for
  URI variables. You will need to expand URI templates before passing them
  into a client constructor or request method.
* Client methods `get()`, `post()`, `put()`, `patch()`, `options()`, etc. are
  now magic methods that will send synchronous requests.
* Replaced `Utils.php` with plain functions in `functions.php`.
* Removed `GuzzleHttp\Collection`.
* Removed `GuzzleHttp\BatchResults`. Batched pool results are now returned as
  an array.
* Removed `GuzzleHttp\Query`. Query string handling is now handled using an
  associative array passed into the `query` request option. The query string
  is serialized using PHP's `http_build_query`. If you need more control, you
  can pass the query string in as a string.
* `GuzzleHttp\QueryParser` has been replaced with the
  `GuzzleHttp\Psr7\parse_query`.


## 5.2.0 - 2015-01-27

* Added `AppliesHeadersInterface` to make applying headers to a request based
  on the body more generic and not specific to `PostBodyInterface`.
* Reduced the number of stack frames needed to send requests.
* Nested futures are now resolved in the client rather than the RequestFsm
* Finishing state transitions is now handled in the RequestFsm rather than the
  RingBridge.
* Added a guard in the Pool class to not use recursion for request retries.


## 5.1.0 - 2014-12-19

* Pool class no longer uses recursion when a request is intercepted.
* The size of a Pool can now be dynamically adjusted using a callback.
  See https://github.com/guzzle/guzzle/pull/943.
* Setting a request option to `null` when creating a request with a client will
  ensure that the option is not set. This allows you to overwrite default
  request options on a per-request basis.
  See https://github.com/guzzle/guzzle/pull/937.
* Added the ability to limit which protocols are allowed for redirects by
  specifying a `protocols` array in the `allow_redirects` request option.
* Nested futures due to retries are now resolved when waiting for synchronous
  responses. See https://github.com/guzzle/guzzle/pull/947.
* `"0"` is now an allowed URI path. See
  https://github.com/guzzle/guzzle/pull/935.
* `Query` no longer typehints on the `$query` argument in the constructor,
  allowing for strings and arrays.
* Exceptions thrown in the `end` event are now correctly wrapped with Guzzle
  specific exceptions if necessary.


## 5.0.3 - 2014-11-03

This change updates query strings so that they are treated as un-encoded values
by default where the value represents an un-encoded value to send over the
wire. A Query object then encodes the value before sending over the wire. This
means that even value query string values (e.g., ":") are url encoded. This
makes the Query class match PHP's http_build_query function. However, if you
want to send requests over the wire using valid query string characters that do
not need to be encoded, then you can provide a string to Url::setQuery() and
pass true as the second argument to specify that the query string is a raw
string that should not be parsed or encoded (unless a call to getQuery() is
subsequently made, forcing the query-string to be converted into a Query
object).


## 5.0.2 - 2014-10-30

* Added a trailing `\r\n` to multipart/form-data payloads. See
  https://github.com/guzzle/guzzle/pull/871
* Added a `GuzzleHttp\Pool::send()` convenience method to match the docs.
* Status codes are now returned as integers. See
  https://github.com/guzzle/guzzle/issues/881
* No longer overwriting an existing `application/x-www-form-urlencoded` header
  when sending POST requests, allowing for customized headers. See
  https://github.com/guzzle/guzzle/issues/877
* Improved path URL serialization.

  * No longer double percent-encoding characters in the path or query string if
    they are already encoded.
  * Now properly encoding the supplied path to a URL object, instead of only
    encoding ' ' and '?'.
  * Note: This has been changed in 5.0.3 to now encode query string values by
    default unless the `rawString` argument is provided when setting the query
    string on a URL: Now allowing many more characters to be present in the
    query string without being percent encoded. See
    https://datatracker.ietf.org/doc/html/rfc3986#appendix-A


## 5.0.1 - 2014-10-16

Bugfix release.

* Fixed an issue where connection errors still returned response object in
  error and end events event though the response is unusable. This has been
  corrected so that a response is not returned in the `getResponse` method of
  these events if the response did not complete. https://github.com/guzzle/guzzle/issues/867
* Fixed an issue where transfer statistics were not being populated in the
  RingBridge. https://github.com/guzzle/guzzle/issues/866


## 5.0.0 - 2014-10-12

Adding support for non-blocking responses and some minor API cleanup.

### New Features

* Added support for non-blocking responses based on `guzzlehttp/guzzle-ring`.
* Added a public API for creating a default HTTP adapter.
* Updated the redirect plugin to be non-blocking so that redirects are sent
  concurrently. Other plugins like this can now be updated to be non-blocking.
* Added a "progress" event so that you can get upload and download progress
  events.
* Added `GuzzleHttp\Pool` which implements FutureInterface and transfers
  requests concurrently using a capped pool size as efficiently as possible.
* Added `hasListeners()` to EmitterInterface.
* Removed `GuzzleHttp\ClientInterface::sendAll` and marked
  `GuzzleHttp\Client::sendAll` as deprecated (it's still there, just not the
  recommended way).

### Breaking changes

The breaking changes in this release are relatively minor. The biggest thing to
look out for is that request and response objects no longer implement fluent
interfaces.

* Removed the fluent interfaces (i.e., `return $this`) from requests,
  responses, `GuzzleHttp\Collection`, `GuzzleHttp\Url`,
  `GuzzleHttp\Query`, `GuzzleHttp\Post\PostBody`, and
  `GuzzleHttp\Cookie\SetCookie`. This blog post provides a good outline of
  why I did this: https://ocramius.github.io/blog/fluent-interfaces-are-evil/.
  This also makes the Guzzle message interfaces compatible with the current
  PSR-7 message proposal.
* Removed "functions.php", so that Guzzle is truly PSR-4 compliant. Except
  for the HTTP request functions from function.php, these functions are now
  implemented in `GuzzleHttp\Utils` using camelCase. `GuzzleHttp\json_decode`
  moved to `GuzzleHttp\Utils::jsonDecode`. `GuzzleHttp\get_path` moved to
  `GuzzleHttp\Utils::getPath`. `GuzzleHttp\set_path` moved to
  `GuzzleHttp\Utils::setPath`. `GuzzleHttp\batch` should now be
  `GuzzleHttp\Pool::batch`, which returns an `objectStorage`. Using functions.php
  caused problems for many users: they aren't PSR-4 compliant, require an
  explicit include, and needed an if-guard to ensure that the functions are not
  declared multiple times.
* Rewrote adapter layer.
    * Removing all classes from `GuzzleHttp\Adapter`, these are now
      implemented as callables that are stored in `GuzzleHttp\Ring\Client`.
    * Removed the concept of "parallel adapters". Sending requests serially or
      concurrently is now handled using a single adapter.
    * Moved `GuzzleHttp\Adapter\Transaction` to `GuzzleHttp\Transaction`. The
      Transaction object now exposes the request, response, and client as public
      properties. The getters and setters have been removed.
* Removed the "headers" event. This event was only useful for changing the
  body a response once the headers of the response were known. You can implement
  a similar behavior in a number of ways. One example might be to use a
  FnStream that has access to the transaction being sent. For example, when the
  first byte is written, you could check if the response headers match your
  expectations, and if so, change the actual stream body that is being
  written to.
* Removed the `asArray` parameter from
  `GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header
  value as an array, then use the newly added `getHeaderAsArray()` method of
  `MessageInterface`. This change makes the Guzzle interfaces compatible with
  the PSR-7 interfaces.
* `GuzzleHttp\Message\MessageFactory` no longer allows subclasses to add
  custom request options using double-dispatch (this was an implementation
  detail). Instead, you should now provide an associative array to the
  constructor which is a mapping of the request option name mapping to a
  function that applies the option value to a request.
* Removed the concept of "throwImmediately" from exceptions and error events.
  This control mechanism was used to stop a transfer of concurrent requests
  from completing. This can now be handled by throwing the exception or by
  cancelling a pool of requests or each outstanding future request individually.
* Updated to "GuzzleHttp\Streams" 3.0.
    * `GuzzleHttp\Stream\StreamInterface::getContents()` no longer accepts a
      `maxLen` parameter. This update makes the Guzzle streams project
      compatible with the current PSR-7 proposal.
    * `GuzzleHttp\Stream\Stream::__construct`,
      `GuzzleHttp\Stream\Stream::factory`, and
      `GuzzleHttp\Stream\Utils::create` no longer accept a size in the second
      argument. They now accept an associative array of options, including the
      "size" key and "metadata" key which can be used to provide custom metadata.


## 4.2.2 - 2014-09-08

* Fixed a memory leak in the CurlAdapter when reusing cURL handles.
* No longer using `request_fulluri` in stream adapter proxies.
* Relative redirects are now based on the last response, not the first response.

## 4.2.1 - 2014-08-19

* Ensuring that the StreamAdapter does not always add a Content-Type header
* Adding automated github releases with a phar and zip

## 4.2.0 - 2014-08-17

* Now merging in default options using a case-insensitive comparison.
  Closes https://github.com/guzzle/guzzle/issues/767
* Added the ability to automatically decode `Content-Encoding` response bodies
  using the `decode_content` request option. This is set to `true` by default
  to decode the response body if it comes over the wire with a
  `Content-Encoding`. Set this value to `false` to disable decoding the
  response content, and pass a string to provide a request `Accept-Encoding`
  header and turn on automatic response decoding. This feature now allows you
  to pass an `Accept-Encoding` header in the headers of a request but still
  disable automatic response decoding.
  Closes https://github.com/guzzle/guzzle/issues/764
* Added the ability to throw an exception immediately when transferring
  requests in parallel. Closes https://github.com/guzzle/guzzle/issues/760
* Updating guzzlehttp/streams dependency to ~2.1
* No longer utilizing the now deprecated namespaced methods from the stream
  package.

## 4.1.8 - 2014-08-14

* Fixed an issue in the CurlFactory that caused setting the `stream=false`
  request option to throw an exception.
  See: https://github.com/guzzle/guzzle/issues/769
* TransactionIterator now calls rewind on the inner iterator.
  See: https://github.com/guzzle/guzzle/pull/765
* You can now set the `Content-Type` header to `multipart/form-data`
  when creating POST requests to force multipart bodies.
  See https://github.com/guzzle/guzzle/issues/768

## 4.1.7 - 2014-08-07

* Fixed an error in the HistoryPlugin that caused the same request and response
  to be logged multiple times when an HTTP protocol error occurs.
* Ensuring that cURL does not add a default Content-Type when no Content-Type
  has been supplied by the user. This prevents the adapter layer from modifying
  the request that is sent over the wire after any listeners may have already
  put the request in a desired state (e.g., signed the request).
* Throwing an exception when you attempt to send requests that have the
  "stream" set to true in parallel using the MultiAdapter.
* Only calling curl_multi_select when there are active cURL handles. This was
  previously changed and caused performance problems on some systems due to PHP
  always selecting until the maximum select timeout.
* Fixed a bug where multipart/form-data POST fields were not correctly
  aggregated (e.g., values with "&").

## 4.1.6 - 2014-08-03

* Added helper methods to make it easier to represent messages as strings,
  including getting the start line and getting headers as a string.

## 4.1.5 - 2014-08-02

* Automatically retrying cURL "Connection died, retrying a fresh connect"
  errors when possible.
* cURL implementation cleanup
* Allowing multiple event subscriber listeners to be registered per event by
  passing an array of arrays of listener configuration.

## 4.1.4 - 2014-07-22

* Fixed a bug that caused multi-part POST requests with more than one field to
  serialize incorrectly.
* Paths can now be set to "0"
* `ResponseInterface::xml` now accepts a `libxml_options` option and added a
  missing default argument that was required when parsing XML response bodies.
* A `save_to` stream is now created lazily, which means that files are not
  created on disk unless a request succeeds.

## 4.1.3 - 2014-07-15

* Various fixes to multipart/form-data POST uploads
* Wrapping function.php in an if-statement to ensure Guzzle can be used
  globally and in a Composer install
* Fixed an issue with generating and merging in events to an event array
* POST headers are only applied before sending a request to allow you to change
  the query aggregator used before uploading
* Added much more robust query string parsing
* Fixed various parsing and normalization issues with URLs
* Fixing an issue where multi-valued headers were not being utilized correctly
  in the StreamAdapter

## 4.1.2 - 2014-06-18

* Added support for sending payloads with GET requests

## 4.1.1 - 2014-06-08

* Fixed an issue related to using custom message factory options in subclasses
* Fixed an issue with nested form fields in a multi-part POST
* Fixed an issue with using the `json` request option for POST requests
* Added `ToArrayInterface` to `GuzzleHttp\Cookie\CookieJar`

## 4.1.0 - 2014-05-27

* Added a `json` request option to easily serialize JSON payloads.
* Added a `GuzzleHttp\json_decode()` wrapper to safely parse JSON.
* Added `setPort()` and `getPort()` to `GuzzleHttp\Message\RequestInterface`.
* Added the ability to provide an emitter to a client in the client constructor.
* Added the ability to persist a cookie session using $_SESSION.
* Added a trait that can be used to add event listeners to an iterator.
* Removed request method constants from RequestInterface.
* Fixed warning when invalid request start-lines are received.
* Updated MessageFactory to work with custom request option methods.
* Updated cacert bundle to latest build.

4.0.2 (2014-04-16)
------------------

* Proxy requests using the StreamAdapter now properly use request_fulluri (#632)
* Added the ability to set scalars as POST fields (#628)

## 4.0.1 - 2014-04-04

* The HTTP status code of a response is now set as the exception code of
  RequestException objects.
* 303 redirects will now correctly switch from POST to GET requests.
* The default parallel adapter of a client now correctly uses the MultiAdapter.
* HasDataTrait now initializes the internal data array as an empty array so
  that the toArray() method always returns an array.

## 4.0.0 - 2014-03-29

* For information on changes and upgrading, see:
  https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40
* Added `GuzzleHttp\batch()` as a convenience function for sending requests in
  parallel without needing to write asynchronous code.
* Restructured how events are added to `GuzzleHttp\ClientInterface::sendAll()`.
  You can now pass a callable or an array of associative arrays where each
  associative array contains the "fn", "priority", and "once" keys.

## 4.0.0.rc-2 - 2014-03-25

* Removed `getConfig()` and `setConfig()` from clients to avoid confusion
  around whether things like base_url, message_factory, etc. should be able to
  be retrieved or modified.
* Added `getDefaultOption()` and `setDefaultOption()` to ClientInterface
* functions.php functions were renamed using snake_case to match PHP idioms
* Added support for `HTTP_PROXY`, `HTTPS_PROXY`, and
  `GUZZLE_CURL_SELECT_TIMEOUT` environment variables
* Added the ability to specify custom `sendAll()` event priorities
* Added the ability to specify custom stream context options to the stream
  adapter.
* Added a functions.php function for `get_path()` and `set_path()`
* CurlAdapter and MultiAdapter now use a callable to generate curl resources
* MockAdapter now properly reads a body and emits a `headers` event
* Updated Url class to check if a scheme and host are set before adding ":"
  and "//". This allows empty Url (e.g., "") to be serialized as "".
* Parsing invalid XML no longer emits warnings
* Curl classes now properly throw AdapterExceptions
* Various performance optimizations
* Streams are created with the faster `Stream\create()` function
* Marked deprecation_proxy() as internal
* Test server is now a collection of static methods on a class

## 4.0.0-rc.1 - 2014-03-15

* See https://github.com/guzzle/guzzle/blob/master/UPGRADING.md#3x-to-40

## 3.8.1 - 2014-01-28

* Bug: Always using GET requests when redirecting from a 303 response
* Bug: CURLOPT_SSL_VERIFYHOST is now correctly set to false when setting `$certificateAuthority` to false in
  `Guzzle\Http\ClientInterface::setSslVerification()`
* Bug: RedirectPlugin now uses strict RFC 3986 compliance when combining a base URL with a relative URL
* Bug: The body of a request can now be set to `"0"`
* Sending PHP stream requests no longer forces `HTTP/1.0`
* Adding more information to ExceptionCollection exceptions so that users have more context, including a stack trace of
  each sub-exception
* Updated the `$ref` attribute in service descriptions to merge over any existing parameters of a schema (rather than
  clobbering everything).
* Merging URLs will now use the query string object from the relative URL (thus allowing custom query aggregators)
* Query strings are now parsed in a way that they do no convert empty keys with no value to have a dangling `=`.
  For example `foo&bar=baz` is now correctly parsed and recognized as `foo&bar=baz` rather than `foo=&bar=baz`.
* Now properly escaping the regular expression delimiter when matching Cookie domains.
* Network access is now disabled when loading XML documents

## 3.8.0 - 2013-12-05

* Added the ability to define a POST name for a file
* JSON response parsing now properly walks additionalProperties
* cURL error code 18 is now retried automatically in the BackoffPlugin
* Fixed a cURL error when URLs contain fragments
* Fixed an issue in the BackoffPlugin retry event where it was trying to access all exceptions as if they were
  CurlExceptions
* CURLOPT_PROGRESS function fix for PHP 5.5 (69fcc1e)
* Added the ability for Guzzle to work with older versions of cURL that do not support `CURLOPT_TIMEOUT_MS`
* Fixed a bug that was encountered when parsing empty header parameters
* UriTemplate now has a `setRegex()` method to match the docs
* The `debug` request parameter now checks if it is truthy rather than if it exists
* Setting the `debug` request parameter to true shows verbose cURL output instead of using the LogPlugin
* Added the ability to combine URLs using strict RFC 3986 compliance
* Command objects can now return the validation errors encountered by the command
* Various fixes to cache revalidation (#437 and 29797e5)
* Various fixes to the AsyncPlugin
* Cleaned up build scripts

## 3.7.4 - 2013-10-02

* Bug fix: 0 is now an allowed value in a description parameter that has a default value (#430)
* Bug fix: SchemaFormatter now returns an integer when formatting to a Unix timestamp
  (see https://github.com/aws/aws-sdk-php/issues/147)
* Bug fix: Cleaned up and fixed URL dot segment removal to properly resolve internal dots
* Minimum PHP version is now properly specified as 5.3.3 (up from 5.3.2) (#420)
* Updated the bundled cacert.pem (#419)
* OauthPlugin now supports adding authentication to headers or query string (#425)

## 3.7.3 - 2013-09-08

* Added the ability to get the exception associated with a request/command when using `MultiTransferException` and
  `CommandTransferException`.
* Setting `additionalParameters` of a response to false is now honored when parsing responses with a service description
* Schemas are only injected into response models when explicitly configured.
* No longer guessing Content-Type based on the path of a request. Content-Type is now only guessed based on the path of
  an EntityBody.
* Bug fix: ChunkedIterator can now properly chunk a \Traversable as well as an \Iterator.
* Bug fix: FilterIterator now relies on `\Iterator` instead of `\Traversable`.
* Bug fix: Gracefully handling malformed responses in RequestMediator::writeResponseBody()
* Bug fix: Replaced call to canCache with canCacheRequest in the CallbackCanCacheStrategy of the CachePlugin
* Bug fix: Visiting XML attributes first before visiting XML children when serializing requests
* Bug fix: Properly parsing headers that contain commas contained in quotes
* Bug fix: mimetype guessing based on a filename is now case-insensitive

## 3.7.2 - 2013-08-02

* Bug fix: Properly URL encoding paths when using the PHP-only version of the UriTemplate expander
  See https://github.com/guzzle/guzzle/issues/371
* Bug fix: Cookie domains are now matched correctly according to RFC 6265
  See https://github.com/guzzle/guzzle/issues/377
* Bug fix: GET parameters are now used when calculating an OAuth signature
* Bug fix: Fixed an issue with cache revalidation where the If-None-Match header was being double quoted
* `Guzzle\Common\AbstractHasDispatcher::dispatch()` now returns the event that was dispatched
* `Guzzle\Http\QueryString::factory()` now guesses the most appropriate query aggregator to used based on the input.
  See https://github.com/guzzle/guzzle/issues/379
* Added a way to add custom domain objects to service description parsing using the `operation.parse_class` event. See
  https://github.com/guzzle/guzzle/pull/380
* cURL multi cleanup and optimizations

## 3.7.1 - 2013-07-05

* Bug fix: Setting default options on a client now works
* Bug fix: Setting options on HEAD requests now works. See #352
* Bug fix: Moving stream factory before send event to before building the stream. See #353
* Bug fix: Cookies no longer match on IP addresses per RFC 6265
* Bug fix: Correctly parsing header parameters that are in `<>` and quotes
* Added `cert` and `ssl_key` as request options
* `Host` header can now diverge from the host part of a URL if the header is set manually
* `Guzzle\Service\Command\LocationVisitor\Request\XmlVisitor` was rewritten to change from using SimpleXML to XMLWriter
* OAuth parameters are only added via the plugin if they aren't already set
* Exceptions are now thrown when a URL cannot be parsed
* Returning `false` if `Guzzle\Http\EntityBody::getContentMd5()` fails
* Not setting a `Content-MD5` on a command if calculating the Content-MD5 fails via the CommandContentMd5Plugin

## 3.7.0 - 2013-06-10

* See UPGRADING.md for more information on how to upgrade.
* Requests now support the ability to specify an array of $options when creating a request to more easily modify a
  request. You can pass a 'request.options' configuration setting to a client to apply default request options to
  every request created by a client (e.g. default query string variables, headers, curl options, etc.).
* Added a static facade class that allows you to use Guzzle with static methods and mount the class to `\Guzzle`.
  See `Guzzle\Http\StaticClient::mount`.
* Added `command.request_options` to `Guzzle\Service\Command\AbstractCommand` to pass request options to requests
      created by a command (e.g. custom headers, query string variables, timeout settings, etc.).
* Stream size in `Guzzle\Stream\PhpStreamRequestFactory` will now be set if Content-Length is returned in the
  headers of a response
* Added `Guzzle\Common\Collection::setPath($path, $value)` to set a value into an array using a nested key
  (e.g. `$collection->setPath('foo/baz/bar', 'test'); echo $collection['foo']['bar']['bar'];`)
* ServiceBuilders now support storing and retrieving arbitrary data
* CachePlugin can now purge all resources for a given URI
* CachePlugin can automatically purge matching cached items when a non-idempotent request is sent to a resource
* CachePlugin now uses the Vary header to determine if a resource is a cache hit
* `Guzzle\Http\Message\Response` now implements `\Serializable`
* Added `Guzzle\Cache\CacheAdapterFactory::fromCache()` to more easily create cache adapters
* `Guzzle\Service\ClientInterface::execute()` now accepts an array, single command, or Traversable
* Fixed a bug in `Guzzle\Http\Message\Header\Link::addLink()`
* Better handling of calculating the size of a stream in `Guzzle\Stream\Stream` using fstat() and caching the size
* `Guzzle\Common\Exception\ExceptionCollection` now creates a more readable exception message
* Fixing BC break: Added back the MonologLogAdapter implementation rather than extending from PsrLog so that older
  Symfony users can still use the old version of Monolog.
* Fixing BC break: Added the implementation back in for `Guzzle\Http\Message\AbstractMessage::getTokenizedHeader()`.
  Now triggering an E_USER_DEPRECATED warning when used. Use `$message->getHeader()->parseParams()`.
* Several performance improvements to `Guzzle\Common\Collection`
* Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
  createRequest, head, delete, put, patch, post, options, prepareRequest
* Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
* Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
* Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
  `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
  resource, string, or EntityBody into the $options parameter to specify the download location of the response.
* Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
  default `array()`
* Added `Guzzle\Stream\StreamInterface::isRepeatable`
* Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
  $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
  $client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))`.
* Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use $client->getConfig()->getPath('request.options/headers')`.
* Removed `Guzzle\Http\ClientInterface::expandTemplate()`
* Removed `Guzzle\Http\ClientInterface::setRequestFactory()`
* Removed `Guzzle\Http\ClientInterface::getCurlMulti()`
* Removed `Guzzle\Http\Message\RequestInterface::canCache`
* Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`
* Removed `Guzzle\Http\Message\RequestInterface::isRedirect`
* Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.
* You can now enable E_USER_DEPRECATED warnings to see if you are using a deprecated method by setting
  `Guzzle\Common\Version::$emitWarnings` to true.
* Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use
      `$request->getResponseBody()->isRepeatable()` instead.
* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
  `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
* Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use
  `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
* Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
* Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
* Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
* Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand.
  These will work through Guzzle 4.0
* Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use [request.options][params].
* Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
* Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use $client->getConfig()->getPath('request.options/headers')`.
* Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use $client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`.
* Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
* Marked `Guzzle\Common\Collection::inject()` as deprecated.
* Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest');`
* CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
  CacheStorageInterface. These two objects and interface will be removed in a future version.
* Always setting X-cache headers on cached responses
* Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
* `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
  $request, Response $response);`
* `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
* `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
* Added `CacheStorageInterface::purge($url)`
* `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
  $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
  CanCacheStrategyInterface $canCache = null)`
* Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`

## 3.6.0 - 2013-05-29

* ServiceDescription now implements ToArrayInterface
* Added command.hidden_params to blacklist certain headers from being treated as additionalParameters
* Guzzle can now correctly parse incomplete URLs
* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
  HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
  CacheControl header implementation.
* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
  Guzzle\Http\Curl\RequestMediator
* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()
* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().
* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle
  directly via interfaces
* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
  but are a no-op until removed.
* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a
  `Guzzle\Service\Command\ArrayCommandInterface`.
* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
  on a request while the request is still being transferred
* The ability to case-insensitively search for header values
* Guzzle\Http\Message\Header::hasExactHeader
* Guzzle\Http\Message\Header::raw. Use getAll()
* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
  instead.
* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess
* Added the ability to cast Model objects to a string to view debug information.

## 3.5.0 - 2013-05-13

* Bug: Fixed a regression so that request responses are parsed only once per oncomplete event rather than multiple times
* Bug: Better cleanup of one-time events across the board (when an event is meant to fire once, it will now remove
  itself from the EventDispatcher)
* Bug: `Guzzle\Log\MessageFormatter` now properly writes "total_time" and "connect_time" values
* Bug: Cloning an EntityEnclosingRequest now clones the EntityBody too
* Bug: Fixed an undefined index error when parsing nested JSON responses with a sentAs parameter that reference a
  non-existent key
* Bug: All __call() method arguments are now required (helps with mocking frameworks)
* Deprecating Response::getRequest() and now using a shallow clone of a request object to remove a circular reference
  to help with refcount based garbage collection of resources created by sending a request
* Deprecating ZF1 cache and log adapters. These will be removed in the next major version.
* Deprecating `Response::getPreviousResponse()` (method signature still exists, but it's deprecated). Use the
  HistoryPlugin for a history.
* Added a `responseBody` alias for the `response_body` location
* Refactored internals to no longer rely on Response::getRequest()
* HistoryPlugin can now be cast to a string
* HistoryPlugin now logs transactions rather than requests and responses to more accurately keep track of the requests
  and responses that are sent over the wire
* Added `getEffectiveUrl()` and `getRedirectCount()` to Response objects

## 3.4.3 - 2013-04-30

* Bug fix: Fixing bug introduced in 3.4.2 where redirect responses are duplicated on the final redirected response
* Added a check to re-extract the temp cacert bundle from the phar before sending each request

## 3.4.2 - 2013-04-29

* Bug fix: Stream objects now work correctly with "a" and "a+" modes
* Bug fix: Removing `Transfer-Encoding: chunked` header when a Content-Length is present
* Bug fix: AsyncPlugin no longer forces HEAD requests
* Bug fix: DateTime timezones are now properly handled when using the service description schema formatter
* Bug fix: CachePlugin now properly handles stale-if-error directives when a request to the origin server fails
* Setting a response on a request will write to the custom request body from the response body if one is specified
* LogPlugin now writes to php://output when STDERR is undefined
* Added the ability to set multiple POST files for the same key in a single call
* application/x-www-form-urlencoded POSTs now use the utf-8 charset by default
* Added the ability to queue CurlExceptions to the MockPlugin
* Cleaned up how manual responses are queued on requests (removed "queued_response" and now using request.before_send)
* Configuration loading now allows remote files

## 3.4.1 - 2013-04-16

* Large refactoring to how CurlMulti handles work. There is now a proxy that sits in front of a pool of CurlMulti
  handles. This greatly simplifies the implementation, fixes a couple bugs, and provides a small performance boost.
* Exceptions are now properly grouped when sending requests in parallel
* Redirects are now properly aggregated when a multi transaction fails
* Redirects now set the response on the original object even in the event of a failure
* Bug fix: Model names are now properly set even when using $refs
* Added support for PHP 5.5's CurlFile to prevent warnings with the deprecated @ syntax
* Added support for oauth_callback in OAuth signatures
* Added support for oauth_verifier in OAuth signatures
* Added support to attempt to retrieve a command first literally, then ucfirst, the with inflection

## 3.4.0 - 2013-04-11

* Bug fix: URLs are now resolved correctly based on https://datatracker.ietf.org/doc/html/rfc3986#section-5.2. #289
* Bug fix: Absolute URLs with a path in a service description will now properly override the base URL. #289
* Bug fix: Parsing a query string with a single PHP array value will now result in an array. #263
* Bug fix: Better normalization of the User-Agent header to prevent duplicate headers. #264.
* Bug fix: Added `number` type to service descriptions.
* Bug fix: empty parameters are removed from an OAuth signature
* Bug fix: Revalidating a cache entry prefers the Last-Modified over the Date header
* Bug fix: Fixed "array to string" error when validating a union of types in a service description
* Bug fix: Removed code that attempted to determine the size of a stream when data is written to the stream
* Bug fix: Not including an `oauth_token` if the value is null in the OauthPlugin.
* Bug fix: Now correctly aggregating successful requests and failed requests in CurlMulti when a redirect occurs.
* The new default CURLOPT_TIMEOUT setting has been increased to 150 seconds so that Guzzle works on poor connections.
* Added a feature to EntityEnclosingRequest::setBody() that will automatically set the Content-Type of the request if
  the Content-Type can be determined based on the entity body or the path of the request.
* Added the ability to overwrite configuration settings in a client when grabbing a throwaway client from a builder.
* Added support for a PSR-3 LogAdapter.
* Added a `command.after_prepare` event
* Added `oauth_callback` parameter to the OauthPlugin
* Added the ability to create a custom stream class when using a stream factory
* Added a CachingEntityBody decorator
* Added support for `additionalParameters` in service descriptions to define how custom parameters are serialized.
* The bundled SSL certificate is now provided in the phar file and extracted when running Guzzle from a phar.
* You can now send any EntityEnclosingRequest with POST fields or POST files and cURL will handle creating bodies
* POST requests using a custom entity body are now treated exactly like PUT requests but with a custom cURL method. This
  means that the redirect behavior of POST requests with custom bodies will not be the same as POST requests that use
  POST fields or files (the latter is only used when emulating a form POST in the browser).
* Lots of cleanup to CurlHandle::factory and RequestFactory::createRequest

## 3.3.1 - 2013-03-10

* Added the ability to create PHP streaming responses from HTTP requests
* Bug fix: Running any filters when parsing response headers with service descriptions
* Bug fix: OauthPlugin fixes to allow for multi-dimensional array signing, and sorting parameters before signing
* Bug fix: Removed the adding of default empty arrays and false Booleans to responses in order to be consistent across
  response location visitors.
* Bug fix: Removed the possibility of creating configuration files with circular dependencies
* RequestFactory::create() now uses the key of a POST file when setting the POST file name
* Added xmlAllowEmpty to serialize an XML body even if no XML specific parameters are set

## 3.3.0 - 2013-03-03

* A large number of performance optimizations have been made
* Bug fix: Added 'wb' as a valid write mode for streams
* Bug fix: `Guzzle\Http\Message\Response::json()` now allows scalar values to be returned
* Bug fix: Fixed bug in `Guzzle\Http\Message\Response` where wrapping quotes were stripped from `getEtag()`
* BC: Removed `Guzzle\Http\Utils` class
* BC: Setting a service description on a client will no longer modify the client's command factories.
* BC: Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using
  the 'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'
* BC: `Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getSteamType()` are no longer converted to
  lowercase
* Operation parameter objects are now lazy loaded internally
* Added ErrorResponsePlugin that can throw errors for responses defined in service description operations' errorResponses
* Added support for instantiating responseType=class responseClass classes. Classes must implement
  `Guzzle\Service\Command\ResponseClassInterface`
* Added support for additionalProperties for top-level parameters in responseType=model responseClasses. These
  additional properties also support locations and can be used to parse JSON responses where the outermost part of the
  JSON is an array
* Added support for nested renaming of JSON models (rename sentAs to name)
* CachePlugin
    * Added support for stale-if-error so that the CachePlugin can now serve stale content from the cache on error
    * Debug headers can now added to cached response in the CachePlugin

## 3.2.0 - 2013-02-14

* CurlMulti is no longer reused globally. A new multi object is created per-client. This helps to isolate clients.
* URLs with no path no longer contain a "/" by default
* Guzzle\Http\QueryString does no longer manages the leading "?". This is now handled in Guzzle\Http\Url.
* BadResponseException no longer includes the full request and response message
* Adding setData() to Guzzle\Service\Description\ServiceDescriptionInterface
* Adding getResponseBody() to Guzzle\Http\Message\RequestInterface
* Various updates to classes to use ServiceDescriptionInterface type hints rather than ServiceDescription
* Header values can now be normalized into distinct values when multiple headers are combined with a comma separated list
* xmlEncoding can now be customized for the XML declaration of a XML service description operation
* Guzzle\Http\QueryString now uses Guzzle\Http\QueryAggregator\QueryAggregatorInterface objects to add custom value
  aggregation and no longer uses callbacks
* The URL encoding implementation of Guzzle\Http\QueryString can now be customized
* Bug fix: Filters were not always invoked for array service description parameters
* Bug fix: Redirects now use a target response body rather than a temporary response body
* Bug fix: The default exponential backoff BackoffPlugin was not giving when the request threshold was exceeded
* Bug fix: Guzzle now takes the first found value when grabbing Cache-Control directives

## 3.1.2 - 2013-01-27

* Refactored how operation responses are parsed. Visitors now include a before() method responsible for parsing the
  response body. For example, the XmlVisitor now parses the XML response into an array in the before() method.
* Fixed an issue where cURL would not automatically decompress responses when the Accept-Encoding header was sent
* CURLOPT_SSL_VERIFYHOST is never set to 1 because it is deprecated (see 5e0ff2ef20f839e19d1eeb298f90ba3598784444)
* Fixed a bug where redirect responses were not chained correctly using getPreviousResponse()
* Setting default headers on a client after setting the user-agent will not erase the user-agent setting

## 3.1.1 - 2013-01-20

* Adding wildcard support to Guzzle\Common\Collection::getPath()
* Adding alias support to ServiceBuilder configs
* Adding Guzzle\Service\Resource\CompositeResourceIteratorFactory and cleaning up factory interface

## 3.1.0 - 2013-01-12

* BC: CurlException now extends from RequestException rather than BadResponseException
* BC: Renamed Guzzle\Plugin\Cache\CanCacheStrategyInterface::canCache() to canCacheRequest() and added CanCacheResponse()
* Added getData to ServiceDescriptionInterface
* Added context array to RequestInterface::setState()
* Bug: Removing hard dependency on the BackoffPlugin from Guzzle\Http
* Bug: Adding required content-type when JSON request visitor adds JSON to a command
* Bug: Fixing the serialization of a service description with custom data
* Made it easier to deal with exceptions thrown when transferring commands or requests in parallel by providing
  an array of successful and failed responses
* Moved getPath from Guzzle\Service\Resource\Model to Guzzle\Common\Collection
* Added Guzzle\Http\IoEmittingEntityBody
* Moved command filtration from validators to location visitors
* Added `extends` attributes to service description parameters
* Added getModels to ServiceDescriptionInterface

## 3.0.7 - 2012-12-19

* Fixing phar detection when forcing a cacert to system if null or true
* Allowing filename to be passed to `Guzzle\Http\Message\Request::setResponseBody()`
* Cleaning up `Guzzle\Common\Collection::inject` method
* Adding a response_body location to service descriptions

## 3.0.6 - 2012-12-09

* CurlMulti performance improvements
* Adding setErrorResponses() to Operation
* composer.json tweaks

## 3.0.5 - 2012-11-18

* Bug: Fixing an infinite recursion bug caused from revalidating with the CachePlugin
* Bug: Response body can now be a string containing "0"
* Bug: Using Guzzle inside of a phar uses system by default but now allows for a custom cacert
* Bug: QueryString::fromString now properly parses query string parameters that contain equal signs
* Added support for XML attributes in service description responses
* DefaultRequestSerializer now supports array URI parameter values for URI template expansion
* Added better mimetype guessing to requests and post files

## 3.0.4 - 2012-11-11

* Bug: Fixed a bug when adding multiple cookies to a request to use the correct glue value
* Bug: Cookies can now be added that have a name, domain, or value set to "0"
* Bug: Using the system cacert bundle when using the Phar
* Added json and xml methods to Response to make it easier to parse JSON and XML response data into data structures
* Enhanced cookie jar de-duplication
* Added the ability to enable strict cookie jars that throw exceptions when invalid cookies are added
* Added setStream to StreamInterface to actually make it possible to implement custom rewind behavior for entity bodies
* Added the ability to create any sort of hash for a stream rather than just an MD5 hash

## 3.0.3 - 2012-11-04

* Implementing redirects in PHP rather than cURL
* Added PECL URI template extension and using as default parser if available
* Bug: Fixed Content-Length parsing of Response factory
* Adding rewind() method to entity bodies and streams. Allows for custom rewinding of non-repeatable streams.
* Adding ToArrayInterface throughout library
* Fixing OauthPlugin to create unique nonce values per request

## 3.0.2 - 2012-10-25

* Magic methods are enabled by default on clients
* Magic methods return the result of a command
* Service clients no longer require a base_url option in the factory
* Bug: Fixed an issue with URI templates where null template variables were being expanded

## 3.0.1 - 2012-10-22

* Models can now be used like regular collection objects by calling filter, map, etc.
* Models no longer require a Parameter structure or initial data in the constructor
* Added a custom AppendIterator to get around a PHP bug with the `\AppendIterator`

## 3.0.0 - 2012-10-15

* Rewrote service description format to be based on Swagger
    * Now based on JSON schema
    * Added nested input structures and nested response models
    * Support for JSON and XML input and output models
    * Renamed `commands` to `operations`
    * Removed dot class notation
    * Removed custom types
* Broke the project into smaller top-level namespaces to be more component friendly
* Removed support for XML configs and descriptions. Use arrays or JSON files.
* Removed the Validation component and Inspector
* Moved all cookie code to Guzzle\Plugin\Cookie
* Magic methods on a Guzzle\Service\Client now return the command un-executed.
* Calling getResult() or getResponse() on a command will lazily execute the command if needed.
* Now shipping with cURL's CA certs and using it by default
* Added previousResponse() method to response objects
* No longer sending Accept and Accept-Encoding headers on every request
* Only sending an Expect header by default when a payload is greater than 1MB
* Added/moved client options:
    * curl.blacklist to curl.option.blacklist
    * Added ssl.certificate_authority
* Added a Guzzle\Iterator component
* Moved plugins from Guzzle\Http\Plugin to Guzzle\Plugin
* Added a more robust backoff retry strategy (replaced the ExponentialBackoffPlugin)
* Added a more robust caching plugin
* Added setBody to response objects
* Updating LogPlugin to use a more flexible MessageFormatter
* Added a completely revamped build process
* Cleaning up Collection class and removing default values from the get method
* Fixed ZF2 cache adapters

## 2.8.8 - 2012-10-15

* Bug: Fixed a cookie issue that caused dot prefixed domains to not match where popular browsers did

## 2.8.7 - 2012-09-30

* Bug: Fixed config file aliases for JSON includes
* Bug: Fixed cookie bug on a request object by using CookieParser to parse cookies on requests
* Bug: Removing the path to a file when sending a Content-Disposition header on a POST upload
* Bug: Hardening request and response parsing to account for missing parts
* Bug: Fixed PEAR packaging
* Bug: Fixed Request::getInfo
* Bug: Fixed cases where CURLM_CALL_MULTI_PERFORM return codes were causing curl transactions to fail
* Adding the ability for the namespace Iterator factory to look in multiple directories
* Added more getters/setters/removers from service descriptions
* Added the ability to remove POST fields from OAuth signatures
* OAuth plugin now supports 2-legged OAuth

## 2.8.6 - 2012-09-05

* Added the ability to modify and build service descriptions
* Added the use of visitors to apply parameters to locations in service descriptions using the dynamic command
* Added a `json` parameter location
* Now allowing dot notation for classes in the CacheAdapterFactory
* Using the union of two arrays rather than an array_merge when extending service builder services and service params
* Ensuring that a service is a string before doing strpos() checks on it when substituting services for references
  in service builder config files.
* Services defined in two different config files that include one another will by default replace the previously
  defined service, but you can now create services that extend themselves and merge their settings over the previous
* The JsonLoader now supports aliasing filenames with different filenames. This allows you to alias something like
  '_default' with a default JSON configuration file.

## 2.8.5 - 2012-08-29

* Bug: Suppressed empty arrays from URI templates
* Bug: Added the missing $options argument from ServiceDescription::factory to enable caching
* Added support for HTTP responses that do not contain a reason phrase in the start-line
* AbstractCommand commands are now invokable
* Added a way to get the data used when signing an Oauth request before a request is sent

## 2.8.4 - 2012-08-15

* Bug: Custom delay time calculations are no longer ignored in the ExponentialBackoffPlugin
* Added the ability to transfer entity bodies as a string rather than streamed. This gets around curl error 65. Set `body_as_string` in a request's curl options to enable.
* Added a StreamInterface, EntityBodyInterface, and added ftell() to Guzzle\Common\Stream
* Added an AbstractEntityBodyDecorator and a ReadLimitEntityBody decorator to transfer only a subset of a decorated stream
* Stream and EntityBody objects will now return the file position to the previous position after a read required operation (e.g. getContentMd5())
* Added additional response status codes
* Removed SSL information from the default User-Agent header
* DELETE requests can now send an entity body
* Added an EventDispatcher to the ExponentialBackoffPlugin and added an ExponentialBackoffLogger to log backoff retries
* Added the ability of the MockPlugin to consume mocked request bodies
* LogPlugin now exposes request and response objects in the extras array

## 2.8.3 - 2012-07-30

* Bug: Fixed a case where empty POST requests were sent as GET requests
* Bug: Fixed a bug in ExponentialBackoffPlugin that caused fatal errors when retrying an EntityEnclosingRequest that does not have a body
* Bug: Setting the response body of a request to null after completing a request, not when setting the state of a request to new
* Added multiple inheritance to service description commands
* Added an ApiCommandInterface and added `getParamNames()` and `hasParam()`
* Removed the default 2mb size cutoff from the Md5ValidatorPlugin so that it now defaults to validating everything
* Changed CurlMulti::perform to pass a smaller timeout to CurlMulti::executeHandles

## 2.8.2 - 2012-07-24

* Bug: Query string values set to 0 are no longer dropped from the query string
* Bug: A Collection object is no longer created each time a call is made to `Guzzle\Service\Command\AbstractCommand::getRequestHeaders()`
* Bug: `+` is now treated as an encoded space when parsing query strings
* QueryString and Collection performance improvements
* Allowing dot notation for class paths in filters attribute of a service descriptions

## 2.8.1 - 2012-07-16

* Loosening Event Dispatcher dependency
* POST redirects can now be customized using CURLOPT_POSTREDIR

## 2.8.0 - 2012-07-15

* BC: Guzzle\Http\Query
    * Query strings with empty variables will always show an equal sign unless the variable is set to QueryString::BLANK (e.g. ?acl= vs ?acl)
    * Changed isEncodingValues() and isEncodingFields() to isUrlEncoding()
    * Changed setEncodeValues(bool) and setEncodeFields(bool) to useUrlEncoding(bool)
    * Changed the aggregation functions of QueryString to be static methods
    * Can now use fromString() with querystrings that have a leading ?
* cURL configuration values can be specified in service descriptions using `curl.` prefixed parameters
* Content-Length is set to 0 before emitting the request.before_send event when sending an empty request body
* Cookies are no longer URL decoded by default
* Bug: URI template variables set to null are no longer expanded

## 2.7.2 - 2012-07-02

* BC: Moving things to get ready for subtree splits. Moving Inflection into Common. Moving Guzzle\Http\Parser to Guzzle\Parser.
* BC: Removing Guzzle\Common\Batch\Batch::count() and replacing it with isEmpty()
* CachePlugin now allows for a custom request parameter function to check if a request can be cached
* Bug fix: CachePlugin now only caches GET and HEAD requests by default
* Bug fix: Using header glue when transferring headers over the wire
* Allowing deeply nested arrays for composite variables in URI templates
* Batch divisors can now return iterators or arrays

## 2.7.1 - 2012-06-26

* Minor patch to update version number in UA string
* Updating build process

## 2.7.0 - 2012-06-25

* BC: Inflection classes moved to Guzzle\Inflection. No longer static methods. Can now inject custom inflectors into classes.
* BC: Removed magic setX methods from commands
* BC: Magic methods mapped to service description commands are now inflected in the command factory rather than the client __call() method
* Verbose cURL options are no longer enabled by default. Set curl.debug to true on a client to enable.
* Bug: Now allowing colons in a response start-line (e.g. HTTP/1.1 503 Service Unavailable: Back-end server is at capacity)
* Guzzle\Service\Resource\ResourceIteratorApplyBatched now internally uses the Guzzle\Common\Batch namespace
* Added Guzzle\Service\Plugin namespace and a PluginCollectionPlugin
* Added the ability to set POST fields and files in a service description
* Guzzle\Http\EntityBody::factory() now accepts objects with a __toString() method
* Adding a command.before_prepare event to clients
* Added BatchClosureTransfer and BatchClosureDivisor
* BatchTransferException now includes references to the batch divisor and transfer strategies
* Fixed some tests so that they pass more reliably
* Added Guzzle\Common\Log\ArrayLogAdapter

## 2.6.6 - 2012-06-10

* BC: Removing Guzzle\Http\Plugin\BatchQueuePlugin
* BC: Removing Guzzle\Service\Command\CommandSet
* Adding generic batching system (replaces the batch queue plugin and command set)
* Updating ZF cache and log adapters and now using ZF's composer repository
* Bug: Setting the name of each ApiParam when creating through an ApiCommand
* Adding result_type, result_doc, deprecated, and doc_url to service descriptions
* Bug: Changed the default cookie header casing back to 'Cookie'

## 2.6.5 - 2012-06-03

* BC: Renaming Guzzle\Http\Message\RequestInterface::getResourceUri() to getResource()
* BC: Removing unused AUTH_BASIC and AUTH_DIGEST constants from
* BC: Guzzle\Http\Cookie is now used to manage Set-Cookie data, not Cookie data
* BC: Renaming methods in the CookieJarInterface
* Moving almost all cookie logic out of the CookiePlugin and into the Cookie or CookieJar implementations
* Making the default glue for HTTP headers ';' instead of ','
* Adding a removeValue to Guzzle\Http\Message\Header
* Adding getCookies() to request interface.
* Making it easier to add event subscribers to HasDispatcherInterface classes. Can now directly call addSubscriber()

## 2.6.4 - 2012-05-30

* BC: Cleaning up how POST files are stored in EntityEnclosingRequest objects. Adding PostFile class.
* BC: Moving ApiCommand specific functionality from the Inspector and on to the ApiCommand
* Bug: Fixing magic method command calls on clients
* Bug: Email constraint only validates strings
* Bug: Aggregate POST fields when POST files are present in curl handle
* Bug: Fixing default User-Agent header
* Bug: Only appending or prepending parameters in commands if they are specified
* Bug: Not requiring response reason phrases or status codes to match a predefined list of codes
* Allowing the use of dot notation for class namespaces when using instance_of constraint
* Added any_match validation constraint
* Added an AsyncPlugin
* Passing request object to the calculateWait method of the ExponentialBackoffPlugin
* Allowing the result of a command object to be changed
* Parsing location and type sub values when instantiating a service description rather than over and over at runtime

## 2.6.3 - 2012-05-23

* [BC] Guzzle\Common\FromConfigInterface no longer requires any config options.
* [BC] Refactoring how POST files are stored on an EntityEnclosingRequest. They are now separate from POST fields.
* You can now use an array of data when creating PUT request bodies in the request factory.
* Removing the requirement that HTTPS requests needed a Cache-Control: public directive to be cacheable.
* [Http] Adding support for Content-Type in multipart POST uploads per upload
* [Http] Added support for uploading multiple files using the same name (foo[0], foo[1])
* Adding more POST data operations for easier manipulation of POST data.
* You can now set empty POST fields.
* The body of a request is only shown on EntityEnclosingRequest objects that do not use POST files.
* Split the Guzzle\Service\Inspector::validateConfig method into two methods. One to initialize when a command is created, and one to validate.
* CS updates

## 2.6.2 - 2012-05-19

* [Http] Better handling of nested scope requests in CurlMulti.  Requests are now always prepares in the send() method rather than the addRequest() method.

## 2.6.1 - 2012-05-19

* [BC] Removing 'path' support in service descriptions.  Use 'uri'.
* [BC] Guzzle\Service\Inspector::parseDocBlock is now protected. Adding getApiParamsForClass() with cache.
* [BC] Removing Guzzle\Common\NullObject.  Use https://github.com/mtdowling/NullObject if you need it.
* [BC] Removing Guzzle\Common\XmlElement.
* All commands, both dynamic and concrete, have ApiCommand objects.
* Adding a fix for CurlMulti so that if all of the connections encounter some sort of curl error, then the loop exits.
* Adding checks to EntityEnclosingRequest so that empty POST files and fields are ignored.
* Making the method signature of Guzzle\Service\Builder\ServiceBuilder::factory more flexible.

## 2.6.0 - 2012-05-15

* [BC] Moving Guzzle\Service\Builder to Guzzle\Service\Builder\ServiceBuilder
* [BC] Executing a Command returns the result of the command rather than the command
* [BC] Moving all HTTP parsing logic to Guzzle\Http\Parsers. Allows for faster C implementations if needed.
* [BC] Changing the Guzzle\Http\Message\Response::setProtocol() method to accept a protocol and version in separate args.
* [BC] Moving ResourceIterator* to Guzzle\Service\Resource
* [BC] Completely refactored ResourceIterators to iterate over a cloned command object
* [BC] Moved Guzzle\Http\UriTemplate to Guzzle\Http\Parser\UriTemplate\UriTemplate
* [BC] Guzzle\Guzzle is now deprecated
* Moving Guzzle\Common\Guzzle::inject to Guzzle\Common\Collection::inject
* Adding Guzzle\Version class to give version information about Guzzle
* Adding Guzzle\Http\Utils class to provide getDefaultUserAgent() and getHttpDate()
* Adding Guzzle\Curl\CurlVersion to manage caching curl_version() data
* ServiceDescription and ServiceBuilder are now cacheable using similar configs
* Changing the format of XML and JSON service builder configs.  Backwards compatible.
* Cleaned up Cookie parsing
* Trimming the default Guzzle User-Agent header
* Adding a setOnComplete() method to Commands that is called when a command completes
* Keeping track of requests that were mocked in the MockPlugin
* Fixed a caching bug in the CacheAdapterFactory
* Inspector objects can be injected into a Command object
* Refactoring a lot of code and tests to be case insensitive when dealing with headers
* Adding Guzzle\Http\Message\HeaderComparison for easy comparison of HTTP headers using a DSL
* Adding the ability to set global option overrides to service builder configs
* Adding the ability to include other service builder config files from within XML and JSON files
* Moving the parseQuery method out of Url and on to QueryString::fromString() as a static factory method.

## 2.5.0 - 2012-05-08

* Major performance improvements
* [BC] Simplifying Guzzle\Common\Collection.  Please check to see if you are using features that are now deprecated.
* [BC] Using a custom validation system that allows a flyweight implementation for much faster validation. No longer using Symfony2 Validation component.
* [BC] No longer supporting "{{ }}" for injecting into command or UriTemplates.  Use "{}"
* Added the ability to passed parameters to all requests created by a client
* Added callback functionality to the ExponentialBackoffPlugin
* Using microtime in ExponentialBackoffPlugin to allow more granular backoff strategies.
* Rewinding request stream bodies when retrying requests
* Exception is thrown when JSON response body cannot be decoded
* Added configurable magic method calls to clients and commands.  This is off by default.
* Fixed a defect that added a hash to every parsed URL part
* Fixed duplicate none generation for OauthPlugin.
* Emitting an event each time a client is generated by a ServiceBuilder
* Using an ApiParams object instead of a Collection for parameters of an ApiCommand
* cache.* request parameters should be renamed to params.cache.*
* Added the ability to set arbitrary curl options on requests (disable_wire, progress, etc.). See CurlHandle.
* Added the ability to disable type validation of service descriptions
* ServiceDescriptions and ServiceBuilders are now Serializable


================================================
FILE: Dockerfile
================================================
FROM composer:latest as setup

WORKDIR /guzzle

RUN set -xe \
    && composer init --name=guzzlehttp/test --description="Simple project for testing Guzzle scripts" --author="Márk Sági-Kazár <mark.sagikazar@gmail.com>" --no-interaction \
    && composer require guzzlehttp/guzzle


FROM php:7.3

WORKDIR /guzzle

COPY --from=setup /guzzle /guzzle


================================================
FILE: LICENSE
================================================
The MIT License (MIT)

Copyright (c) 2011 Michael Dowling <mtdowling@gmail.com>
Copyright (c) 2012 Jeremy Lindblom <jeremeamia@gmail.com>
Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk>
Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com>
Copyright (c) 2015 Tobias Schultze <webmaster@tubo-world.de>
Copyright (c) 2016 Tobias Nyholm <tobias.nyholm@gmail.com>
Copyright (c) 2016 George Mponos <gmponos@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.


================================================
FILE: Makefile
================================================
help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  start-server                   to start the test server"
	@echo "  stop-server                    to stop the test server"
	@echo "  test                           to perform unit tests.  Provide TEST to perform a specific test."
	@echo "  coverage                       to perform unit tests with code coverage. Provide TEST to perform a specific test."
	@echo "  coverage-show                  to show the code coverage report"
	@echo "  clean                          to remove build artifacts"
	@echo "  docs                           to build the Sphinx docs"
	@echo "  docs-show                      to view the Sphinx docs"
	@echo "  static                         to run phpstan and php-cs-fixer on the codebase"
	@echo "  static-phpstan                 to run phpstan on the codebase"
	@echo "  static-phpstan-update-baseline to regenerate the phpstan baseline file"
	@echo "  static-codestyle-fix           to run php-cs-fixer on the codebase, writing the changes"
	@echo "  static-codestyle-check         to run php-cs-fixer on the codebase"

start-server: stop-server
	node tests/server.js &> /dev/null &
	./vendor/bin/http_test_server &> /dev/null &

stop-server:
	@PID=$(shell ps axo pid,command \
	  | grep 'tests/server.js' \
	  | grep -v grep \
	  | cut -f 1 -d " "\
	) && [ -n "$$PID" ] && kill $$PID || true
	@PID=$(shell ps axo pid,command \
	  | grep 'vendor/bin/http_test_server' \
	  | grep -v grep \
	  | cut -f 1 -d " "\
	) && [ -n "$$PID" ] && kill $$PID || true

test: start-server
	vendor/bin/phpunit
	$(MAKE) stop-server

coverage: start-server
	vendor/bin/phpunit --coverage-html=build/artifacts/coverage
	$(MAKE) stop-server

coverage-show: view-coverage

view-coverage:
	open build/artifacts/coverage/index.html

clean:
	rm -rf artifacts/*

docs:
	cd docs && make html && cd ..

docs-show:
	open docs/_build/html/index.html

static: static-phpstan static-psalm static-codestyle-check

static-psalm:
	composer install
	composer bin psalm update
	vendor/bin/psalm.phar $(PSALM_PARAMS)

static-psalm-update-baseline:
	composer install
	composer bin psalm update
	$(MAKE) static-psalm PSALM_PARAMS="--set-baseline=psalm-baseline.xml"

static-phpstan:
	composer install
	composer bin phpstan update
	vendor/bin/phpstan analyze $(PHPSTAN_PARAMS)

static-phpstan-update-baseline:
	composer install
	composer bin phpstan update
	$(MAKE) static-phpstan PHPSTAN_PARAMS="--generate-baseline"

static-codestyle-fix:
	composer install
	composer bin php-cs-fixer update
	vendor/bin/php-cs-fixer fix --diff $(CS_PARAMS)

static-codestyle-check:
	$(MAKE) static-codestyle-fix CS_PARAMS="--dry-run"

.PHONY: docs coverage-show view-coverage


================================================
FILE: README.md
================================================
![Guzzle](.github/logo.png?raw=true)

# Guzzle, PHP HTTP client

[![Latest Version](https://img.shields.io/github/release/guzzle/guzzle.svg?style=flat-square)](https://github.com/guzzle/guzzle/releases)
[![Build Status](https://img.shields.io/github/actions/workflow/status/guzzle/guzzle/ci.yml?label=ci%20build&style=flat-square)](https://github.com/guzzle/guzzle/actions?query=workflow%3ACI)
[![Total Downloads](https://img.shields.io/packagist/dt/guzzlehttp/guzzle.svg?style=flat-square)](https://packagist.org/packages/guzzlehttp/guzzle)

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
trivial to integrate with web services.

- Simple interface for building query strings, POST requests, streaming large
  uploads, streaming large downloads, using HTTP cookies, uploading JSON data,
  etc...
- Can send both synchronous and asynchronous requests using the same interface.
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
  to utilize other PSR-7 compatible libraries with Guzzle.
- Supports PSR-18 allowing interoperability between other PSR-18 HTTP Clients.
- Abstracts away the underlying HTTP transport, allowing you to write
  environment and transport agnostic code; i.e., no hard dependency on cURL,
  PHP streams, sockets, or non-blocking event loops.
- Middleware system allows you to augment and compose client behavior.

```php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://api.github.com/repos/guzzle/guzzle');

echo $response->getStatusCode(); // 200
echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
echo $response->getBody(); // '{"id": 1420053, "name": "guzzle", ...}'

// Send an asynchronous request.
$request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
$promise = $client->sendAsync($request)->then(function ($response) {
    echo 'I completed! ' . $response->getBody();
});

$promise->wait();
```

## Help and docs

We use GitHub issues only to discuss bugs and new features. For support please refer to:

- [Documentation](https://docs.guzzlephp.org)
- [Stack Overflow](https://stackoverflow.com/questions/tagged/guzzle)
- [#guzzle](https://app.slack.com/client/T0D2S9JCT/CE6UAAKL4) channel on [PHP-HTTP Slack](https://slack.httplug.io/)
- [Gitter](https://gitter.im/guzzle/guzzle)


## Installing Guzzle

The recommended way to install Guzzle is through
[Composer](https://getcomposer.org/).

```bash
composer require guzzlehttp/guzzle
```


## Version Guidance

| Version | Status              | Packagist           | Namespace    | Repo                | Docs                | PSR-7 | PHP Version  |
|---------|---------------------|---------------------|--------------|---------------------|---------------------|-------|--------------|
| 3.x     | EOL (2016-10-31)    | `guzzle/guzzle`     | `Guzzle`     | [v3][guzzle-3-repo] | [v3][guzzle-3-docs] | No    | >=5.3.3,<7.0 |
| 4.x     | EOL (2016-10-31)    | `guzzlehttp/guzzle` | `GuzzleHttp` | [v4][guzzle-4-repo] | N/A                 | No    | >=5.4,<7.0   |
| 5.x     | EOL (2019-10-31)    | `guzzlehttp/guzzle` | `GuzzleHttp` | [v5][guzzle-5-repo] | [v5][guzzle-5-docs] | No    | >=5.4,<7.4   |
| 6.x     | EOL (2023-10-31)    | `guzzlehttp/guzzle` | `GuzzleHttp` | [v6][guzzle-6-repo] | [v6][guzzle-6-docs] | Yes   | >=5.5,<8.0   |
| 7.x     | Latest              | `guzzlehttp/guzzle` | `GuzzleHttp` | [v7][guzzle-7-repo] | [v7][guzzle-7-docs] | Yes   | >=7.2.5,<8.5 |

[guzzle-3-repo]: https://github.com/guzzle/guzzle3
[guzzle-4-repo]: https://github.com/guzzle/guzzle/tree/4.x
[guzzle-5-repo]: https://github.com/guzzle/guzzle/tree/5.3
[guzzle-6-repo]: https://github.com/guzzle/guzzle/tree/6.5
[guzzle-7-repo]: https://github.com/guzzle/guzzle
[guzzle-3-docs]: https://guzzle3.readthedocs.io/
[guzzle-5-docs]: https://docs.guzzlephp.org/en/5.3/
[guzzle-6-docs]: https://docs.guzzlephp.org/en/6.5/
[guzzle-7-docs]: https://docs.guzzlephp.org/en/latest/


## Security

If you discover a security vulnerability within this package, please send an email to security@tidelift.com. All security vulnerabilities will be promptly addressed. Please do not disclose security-related issues publicly until a fix has been announced. Please see [Security Policy](https://github.com/guzzle/guzzle/security/policy) for more information.

## License

Guzzle is made available under the MIT License (MIT). Please see [License File](LICENSE) for more information.

## For Enterprise

Available as part of the Tidelift Subscription

The maintainers of Guzzle and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-guzzlehttp-guzzle?utm_source=packagist-guzzlehttp-guzzle&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)


================================================
FILE: UPGRADING.md
================================================
Guzzle Upgrade Guide
====================

6.0 to 7.0
----------

In order to take advantage of the new features of PHP, Guzzle dropped the support
of PHP 5. The minimum supported PHP version is now PHP 7.2. Type hints and return
types for functions and methods have been added wherever possible. 

Please make sure:
- You are calling a function or a method with the correct type.
- If you extend a class of Guzzle; update all signatures on methods you override.

#### Other backwards compatibility breaking changes

- Class `GuzzleHttp\UriTemplate` is removed.
- Class `GuzzleHttp\Exception\SeekException` is removed.
- Classes `GuzzleHttp\Exception\BadResponseException`, `GuzzleHttp\Exception\ClientException`, 
  `GuzzleHttp\Exception\ServerException` can no longer be initialized with an empty
  Response as argument.
- Class `GuzzleHttp\Exception\ConnectException` now extends `GuzzleHttp\Exception\TransferException`
  instead of `GuzzleHttp\Exception\RequestException`.
- Function `GuzzleHttp\Exception\ConnectException::getResponse()` is removed.
- Function `GuzzleHttp\Exception\ConnectException::hasResponse()` is removed.
- Constant `GuzzleHttp\ClientInterface::VERSION` is removed. Added `GuzzleHttp\ClientInterface::MAJOR_VERSION` instead.
- Function `GuzzleHttp\Exception\RequestException::getResponseBodySummary` is removed.
  Use `\GuzzleHttp\Psr7\get_message_body_summary` as an alternative.
- Function `GuzzleHttp\Cookie\CookieJar::getCookieValue` is removed.
- Request option `exceptions` is removed. Please use `http_errors`.
- Request option `save_to` is removed. Please use `sink`.
- Pool option `pool_size` is removed. Please use `concurrency`.
- We now look for environment variables in the `$_SERVER` super global, due to thread safety issues with `getenv`. We continue to fallback to `getenv` in CLI environments, for maximum compatibility.
- The `get`, `head`, `put`, `post`, `patch`, `delete`, `getAsync`, `headAsync`, `putAsync`, `postAsync`, `patchAsync`, and `deleteAsync` methods are now implemented as genuine methods on `GuzzleHttp\Client`, with strong typing. The original `__call` implementation remains unchanged for now, for maximum backwards compatibility, but won't be invoked under normal operation.
- The `log` middleware will log the errors with level `error` instead of `notice` 
- Support for international domain names (IDN) is now disabled by default, and enabling it requires installing ext-intl, linked against a modern version of the C library (ICU 4.6 or higher).

#### Native functions calls

All internal native functions calls of Guzzle are now prefixed with a slash. This
change makes it impossible for method overloading by other libraries or applications.
Example:

```php
// Before:
curl_version();

// After:
\curl_version();
```

For the full diff you can check [here](https://github.com/guzzle/guzzle/compare/6.5.4..master).

5.0 to 6.0
----------

Guzzle now uses [PSR-7](https://www.php-fig.org/psr/psr-7/) for HTTP messages.
Due to the fact that these messages are immutable, this prompted a refactoring
of Guzzle to use a middleware based system rather than an event system. Any
HTTP message interaction (e.g., `GuzzleHttp\Message\Request`) need to be
updated to work with the new immutable PSR-7 request and response objects. Any
event listeners or subscribers need to be updated to become middleware
functions that wrap handlers (or are injected into a
`GuzzleHttp\HandlerStack`).

- Removed `GuzzleHttp\BatchResults`
- Removed `GuzzleHttp\Collection`
- Removed `GuzzleHttp\HasDataTrait`
- Removed `GuzzleHttp\ToArrayInterface`
- The `guzzlehttp/streams` dependency has been removed. Stream functionality
  is now present in the `GuzzleHttp\Psr7` namespace provided by the
  `guzzlehttp/psr7` package.
- Guzzle no longer uses ReactPHP promises and now uses the
  `guzzlehttp/promises` library. We use a custom promise library for three
  significant reasons:
  1. React promises (at the time of writing this) are recursive. Promise
     chaining and promise resolution will eventually blow the stack. Guzzle
     promises are not recursive as they use a sort of trampolining technique.
     Note: there has been movement in the React project to modify promises to
     no longer utilize recursion.
  2. Guzzle needs to have the ability to synchronously block on a promise to
     wait for a result. Guzzle promises allows this functionality (and does
     not require the use of recursion).
  3. Because we need to be able to wait on a result, doing so using React
     promises requires wrapping react promises with RingPHP futures. This
     overhead is no longer needed, reducing stack sizes, reducing complexity,
     and improving performance.
- `GuzzleHttp\Mimetypes` has been moved to a function in
  `GuzzleHttp\Psr7\mimetype_from_extension` and
  `GuzzleHttp\Psr7\mimetype_from_filename`.
- `GuzzleHttp\Query` and `GuzzleHttp\QueryParser` have been removed. Query
  strings must now be passed into request objects as strings, or provided to
  the `query` request option when creating requests with clients. The `query`
  option uses PHP's `http_build_query` to convert an array to a string. If you
  need a different serialization technique, you will need to pass the query
  string in as a string. There are a couple helper functions that will make
  working with query strings easier: `GuzzleHttp\Psr7\parse_query` and
  `GuzzleHttp\Psr7\build_query`.
- Guzzle no longer has a dependency on RingPHP. Due to the use of a middleware
  system based on PSR-7, using RingPHP and it's middleware system as well adds
  more complexity than the benefits it provides. All HTTP handlers that were
  present in RingPHP have been modified to work directly with PSR-7 messages
  and placed in the `GuzzleHttp\Handler` namespace. This significantly reduces
  complexity in Guzzle, removes a dependency, and improves performance. RingPHP
  will be maintained for Guzzle 5 support, but will no longer be a part of
  Guzzle 6.
- As Guzzle now uses a middleware based systems the event system and RingPHP
  integration has been removed. Note: while the event system has been removed,
  it is possible to add your own type of event system that is powered by the
  middleware system.
  - Removed the `Event` namespace.
  - Removed the `Subscriber` namespace.
  - Removed `Transaction` class
  - Removed `RequestFsm`
  - Removed `RingBridge`
  - `GuzzleHttp\Subscriber\Cookie` is now provided by
    `GuzzleHttp\Middleware::cookies`
  - `GuzzleHttp\Subscriber\HttpError` is now provided by
    `GuzzleHttp\Middleware::httpError`
  - `GuzzleHttp\Subscriber\History` is now provided by
    `GuzzleHttp\Middleware::history`
  - `GuzzleHttp\Subscriber\Mock` is now provided by
    `GuzzleHttp\Handler\MockHandler`
  - `GuzzleHttp\Subscriber\Prepare` is now provided by
    `GuzzleHttp\PrepareBodyMiddleware`
  - `GuzzleHttp\Subscriber\Redirect` is now provided by
    `GuzzleHttp\RedirectMiddleware`
- Guzzle now uses `Psr\Http\Message\UriInterface` (implements in
  `GuzzleHttp\Psr7\Uri`) for URI support. `GuzzleHttp\Url` is now gone.
- Static functions in `GuzzleHttp\Utils` have been moved to namespaced
  functions under the `GuzzleHttp` namespace. This requires either a Composer
  based autoloader or you to include functions.php.
- `GuzzleHttp\ClientInterface::getDefaultOption` has been renamed to
  `GuzzleHttp\ClientInterface::getConfig`.
- `GuzzleHttp\ClientInterface::setDefaultOption` has been removed.
- The `json` and `xml` methods of response objects has been removed. With the
  migration to strictly adhering to PSR-7 as the interface for Guzzle messages,
  adding methods to message interfaces would actually require Guzzle messages
  to extend from PSR-7 messages rather then work with them directly.

## Migrating to middleware

The change to PSR-7 unfortunately required significant refactoring to Guzzle
due to the fact that PSR-7 messages are immutable. Guzzle 5 relied on an event
system from plugins. The event system relied on mutability of HTTP messages and
side effects in order to work. With immutable messages, you have to change your
workflow to become more about either returning a value (e.g., functional
middlewares) or setting a value on an object. Guzzle v6 has chosen the
functional middleware approach.

Instead of using the event system to listen for things like the `before` event,
you now create a stack based middleware function that intercepts a request on
the way in and the promise of the response on the way out. This is a much
simpler and more predictable approach than the event system and works nicely
with PSR-7 middleware. Due to the use of promises, the middleware system is
also asynchronous.

v5:

```php
use GuzzleHttp\Event\BeforeEvent;
$client = new GuzzleHttp\Client();
// Get the emitter and listen to the before event.
$client->getEmitter()->on('before', function (BeforeEvent $e) {
    // Guzzle v5 events relied on mutation
    $e->getRequest()->setHeader('X-Foo', 'Bar');
});
```

v6:

In v6, you can modify the request before it is sent using the `mapRequest`
middleware. The idiomatic way in v6 to modify the request/response lifecycle is
to setup a handler middleware stack up front and inject the handler into a
client.

```php
use GuzzleHttp\Middleware;
// Create a handler stack that has all of the default middlewares attached
$handler = GuzzleHttp\HandlerStack::create();
// Push the handler onto the handler stack
$handler->push(Middleware::mapRequest(function (RequestInterface $request) {
    // Notice that we have to return a request object
    return $request->withHeader('X-Foo', 'Bar');
}));
// Inject the handler into the client
$client = new GuzzleHttp\Client(['handler' => $handler]);
```

## POST Requests

This version added the [`form_params`](https://docs.guzzlephp.org/en/latest/request-options.html#form_params)
and `multipart` request options. `form_params` is an associative array of
strings or array of strings and is used to serialize an
`application/x-www-form-urlencoded` POST request. The
[`multipart`](https://docs.guzzlephp.org/en/latest/request-options.html#multipart)
option is now used to send a multipart/form-data POST request.

`GuzzleHttp\Post\PostFile` has been removed. Use the `multipart` option to add
POST files to a multipart/form-data request.

The `body` option no longer accepts an array to send POST requests. Please use
`multipart` or `form_params` instead.

The `base_url` option has been renamed to `base_uri`.

4.x to 5.0
----------

## Rewritten Adapter Layer

Guzzle now uses [RingPHP](https://ringphp.readthedocs.org/en/latest) to send
HTTP requests. The `adapter` option in a `GuzzleHttp\Client` constructor
is still supported, but it has now been renamed to `handler`. Instead of
passing a `GuzzleHttp\Adapter\AdapterInterface`, you must now pass a PHP
`callable` that follows the RingPHP specification.

## Removed Fluent Interfaces

[Fluent interfaces were removed](https://ocramius.github.io/blog/fluent-interfaces-are-evil/)
from the following classes:

- `GuzzleHttp\Collection`
- `GuzzleHttp\Url`
- `GuzzleHttp\Query`
- `GuzzleHttp\Post\PostBody`
- `GuzzleHttp\Cookie\SetCookie`

## Removed functions.php

Removed "functions.php", so that Guzzle is truly PSR-4 compliant. The following
functions can be used as replacements.

- `GuzzleHttp\json_decode` -> `GuzzleHttp\Utils::jsonDecode`
- `GuzzleHttp\get_path` -> `GuzzleHttp\Utils::getPath`
- `GuzzleHttp\Utils::setPath` -> `GuzzleHttp\set_path`
- `GuzzleHttp\Pool::batch` -> `GuzzleHttp\batch`. This function is, however,
  deprecated in favor of using `GuzzleHttp\Pool::batch()`.

The "procedural" global client has been removed with no replacement (e.g.,
`GuzzleHttp\get()`, `GuzzleHttp\post()`, etc.). Use a `GuzzleHttp\Client`
object as a replacement.

## `throwImmediately` has been removed

The concept of "throwImmediately" has been removed from exceptions and error
events. This control mechanism was used to stop a transfer of concurrent
requests from completing. This can now be handled by throwing the exception or
by cancelling a pool of requests or each outstanding future request
individually.

## headers event has been removed

Removed the "headers" event. This event was only useful for changing the
body a response once the headers of the response were known. You can implement
a similar behavior in a number of ways. One example might be to use a
FnStream that has access to the transaction being sent. For example, when the
first byte is written, you could check if the response headers match your
expectations, and if so, change the actual stream body that is being
written to.

## Updates to HTTP Messages

Removed the `asArray` parameter from
`GuzzleHttp\Message\MessageInterface::getHeader`. If you want to get a header
value as an array, then use the newly added `getHeaderAsArray()` method of
`MessageInterface`. This change makes the Guzzle interfaces compatible with
the PSR-7 interfaces.

3.x to 4.0
----------

## Overarching changes:

- Now requires PHP 5.4 or greater.
- No longer requires cURL to send requests.
- Guzzle no longer wraps every exception it throws. Only exceptions that are
  recoverable are now wrapped by Guzzle.
- Various namespaces have been removed or renamed.
- No longer requiring the Symfony EventDispatcher. A custom event dispatcher
  based on the Symfony EventDispatcher is
  now utilized in `GuzzleHttp\Event\EmitterInterface` (resulting in significant
  speed and functionality improvements).

Changes per Guzzle 3.x namespace are described below.

## Batch

The `Guzzle\Batch` namespace has been removed. This is best left to
third-parties to implement on top of Guzzle's core HTTP library.

## Cache

The `Guzzle\Cache` namespace has been removed. (Todo: No suitable replacement
has been implemented yet, but hoping to utilize a PSR cache interface).

## Common

- Removed all of the wrapped exceptions. It's better to use the standard PHP
  library for unrecoverable exceptions.
- `FromConfigInterface` has been removed.
- `Guzzle\Common\Version` has been removed. The VERSION constant can be found
  at `GuzzleHttp\ClientInterface::VERSION`.

### Collection

- `getAll` has been removed. Use `toArray` to convert a collection to an array.
- `inject` has been removed.
- `keySearch` has been removed.
- `getPath` no longer supports wildcard expressions. Use something better like
  JMESPath for this.
- `setPath` now supports appending to an existing array via the `[]` notation.

### Events

Guzzle no longer requires Symfony's EventDispatcher component. Guzzle now uses
`GuzzleHttp\Event\Emitter`.

- `Symfony\Component\EventDispatcher\EventDispatcherInterface` is replaced by
  `GuzzleHttp\Event\EmitterInterface`.
- `Symfony\Component\EventDispatcher\EventDispatcher` is replaced by
  `GuzzleHttp\Event\Emitter`.
- `Symfony\Component\EventDispatcher\Event` is replaced by
  `GuzzleHttp\Event\Event`, and Guzzle now has an EventInterface in
  `GuzzleHttp\Event\EventInterface`.
- `AbstractHasDispatcher` has moved to a trait, `HasEmitterTrait`, and
  `HasDispatcherInterface` has moved to `HasEmitterInterface`. Retrieving the
  event emitter of a request, client, etc. now uses the `getEmitter` method
  rather than the `getDispatcher` method.

#### Emitter

- Use the `once()` method to add a listener that automatically removes itself
  the first time it is invoked.
- Use the `listeners()` method to retrieve a list of event listeners rather than
  the `getListeners()` method.
- Use `emit()` instead of `dispatch()` to emit an event from an emitter.
- Use `attach()` instead of `addSubscriber()` and `detach()` instead of
  `removeSubscriber()`.

```php
$mock = new Mock();
// 3.x
$request->getEventDispatcher()->addSubscriber($mock);
$request->getEventDispatcher()->removeSubscriber($mock);
// 4.x
$request->getEmitter()->attach($mock);
$request->getEmitter()->detach($mock);
```

Use the `on()` method to add a listener rather than the `addListener()` method.

```php
// 3.x
$request->getEventDispatcher()->addListener('foo', function (Event $event) { /* ... */ } );
// 4.x
$request->getEmitter()->on('foo', function (Event $event, $name) { /* ... */ } );
```

## Http

### General changes

- The cacert.pem certificate has been moved to `src/cacert.pem`.
- Added the concept of adapters that are used to transfer requests over the
  wire.
- Simplified the event system.
- Sending requests in parallel is still possible, but batching is no longer a
  concept of the HTTP layer. Instead, you must use the `complete` and `error`
  events to asynchronously manage parallel request transfers.
- `Guzzle\Http\Url` has moved to `GuzzleHttp\Url`.
- `Guzzle\Http\QueryString` has moved to `GuzzleHttp\Query`.
- QueryAggregators have been rewritten so that they are simply callable
  functions.
- `GuzzleHttp\StaticClient` has been removed. Use the functions provided in
  `functions.php` for an easy to use static client instance.
- Exceptions in `GuzzleHttp\Exception` have been updated to all extend from
  `GuzzleHttp\Exception\TransferException`.

### Client

Calling methods like `get()`, `post()`, `head()`, etc. no longer create and
return a request, but rather creates a request, sends the request, and returns
the response.

```php
// 3.0
$request = $client->get('/');
$response = $request->send();

// 4.0
$response = $client->get('/');

// or, to mirror the previous behavior
$request = $client->createRequest('GET', '/');
$response = $client->send($request);
```

`GuzzleHttp\ClientInterface` has changed.

- The `send` method no longer accepts more than one request. Use `sendAll` to
  send multiple requests in parallel.
- `setUserAgent()` has been removed. Use a default request option instead. You
  could, for example, do something like:
  `$client->setConfig('defaults/headers/User-Agent', 'Foo/Bar ' . $client::getDefaultUserAgent())`.
- `setSslVerification()` has been removed. Use default request options instead,
  like `$client->setConfig('defaults/verify', true)`.

`GuzzleHttp\Client` has changed.

- The constructor now accepts only an associative array. You can include a
  `base_url` string or array to use a URI template as the base URL of a client.
  You can also specify a `defaults` key that is an associative array of default
  request options. You can pass an `adapter` to use a custom adapter,
  `batch_adapter` to use a custom adapter for sending requests in parallel, or
  a `message_factory` to change the factory used to create HTTP requests and
  responses.
- The client no longer emits a `client.create_request` event.
- Creating requests with a client no longer automatically utilize a URI
  template. You must pass an array into a creational method (e.g.,
  `createRequest`, `get`, `put`, etc.) in order to expand a URI template.

### Messages

Messages no longer have references to their counterparts (i.e., a request no
longer has a reference to it's response, and a response no loger has a
reference to its request). This association is now managed through a
`GuzzleHttp\Adapter\TransactionInterface` object. You can get references to
these transaction objects using request events that are emitted over the
lifecycle of a request.

#### Requests with a body

- `GuzzleHttp\Message\EntityEnclosingRequest` and
  `GuzzleHttp\Message\EntityEnclosingRequestInterface` have been removed. The
  separation between requests that contain a body and requests that do not
  contain a body has been removed, and now `GuzzleHttp\Message\RequestInterface`
  handles both use cases.
- Any method that previously accepts a `GuzzleHttp\Response` object now accept a
  `GuzzleHttp\Message\ResponseInterface`.
- `GuzzleHttp\Message\RequestFactoryInterface` has been renamed to
  `GuzzleHttp\Message\MessageFactoryInterface`. This interface is used to create
  both requests and responses and is implemented in
  `GuzzleHttp\Message\MessageFactory`.
- POST field and file methods have been removed from the request object. You
  must now use the methods made available to `GuzzleHttp\Post\PostBodyInterface`
  to control the format of a POST body. Requests that are created using a
  standard `GuzzleHttp\Message\MessageFactoryInterface` will automatically use
  a `GuzzleHttp\Post\PostBody` body if the body was passed as an array or if
  the method is POST and no body is provided.

```php
$request = $client->createRequest('POST', '/');
$request->getBody()->setField('foo', 'bar');
$request->getBody()->addFile(new PostFile('file_key', fopen('/path/to/content', 'r')));
```

#### Headers

- `GuzzleHttp\Message\Header` has been removed. Header values are now simply
  represented by an array of values or as a string. Header values are returned
  as a string by default when retrieving a header value from a message. You can
  pass an optional argument of `true` to retrieve a header value as an array
  of strings instead of a single concatenated string.
- `GuzzleHttp\PostFile` and `GuzzleHttp\PostFileInterface` have been moved to
  `GuzzleHttp\Post`. This interface has been simplified and now allows the
  addition of arbitrary headers.
- Custom headers like `GuzzleHttp\Message\Header\Link` have been removed. Most
  of the custom headers are now handled separately in specific
  subscribers/plugins, and `GuzzleHttp\Message\HeaderValues::parseParams()` has
  been updated to properly handle headers that contain parameters (like the
  `Link` header).

#### Responses

- `GuzzleHttp\Message\Response::getInfo()` and
  `GuzzleHttp\Message\Response::setInfo()` have been removed. Use the event
  system to retrieve this type of information.
- `GuzzleHttp\Message\Response::getRawHeaders()` has been removed.
- `GuzzleHttp\Message\Response::getMessage()` has been removed.
- `GuzzleHttp\Message\Response::calculateAge()` and other cache specific
  methods have moved to the CacheSubscriber.
- Header specific helper functions like `getContentMd5()` have been removed.
  Just use `getHeader('Content-MD5')` instead.
- `GuzzleHttp\Message\Response::setRequest()` and
  `GuzzleHttp\Message\Response::getRequest()` have been removed. Use the event
  system to work with request and response objects as a transaction.
- `GuzzleHttp\Message\Response::getRedirectCount()` has been removed. Use the
  Redirect subscriber instead.
- `GuzzleHttp\Message\Response::isSuccessful()` and other related methods have
  been removed. Use `getStatusCode()` instead.

#### Streaming responses

Streaming requests can now be created by a client directly, returning a
`GuzzleHttp\Message\ResponseInterface` object that contains a body stream
referencing an open PHP HTTP stream.

```php
// 3.0
use Guzzle\Stream\PhpStreamRequestFactory;
$request = $client->get('/');
$factory = new PhpStreamRequestFactory();
$stream = $factory->fromRequest($request);
$data = $stream->read(1024);

// 4.0
$response = $client->get('/', ['stream' => true]);
// Read some data off of the stream in the response body
$data = $response->getBody()->read(1024);
```

#### Redirects

The `configureRedirects()` method has been removed in favor of a
`allow_redirects` request option.

```php
// Standard redirects with a default of a max of 5 redirects
$request = $client->createRequest('GET', '/', ['allow_redirects' => true]);

// Strict redirects with a custom number of redirects
$request = $client->createRequest('GET', '/', [
    'allow_redirects' => ['max' => 5, 'strict' => true]
]);
```

#### EntityBody

EntityBody interfaces and classes have been removed or moved to
`GuzzleHttp\Stream`. All classes and interfaces that once required
`GuzzleHttp\EntityBodyInterface` now require
`GuzzleHttp\Stream\StreamInterface`. Creating a new body for a request no
longer uses `GuzzleHttp\EntityBody::factory` but now uses
`GuzzleHttp\Stream\Stream::factory` or even better:
`GuzzleHttp\Stream\create()`.

- `Guzzle\Http\EntityBodyInterface` is now `GuzzleHttp\Stream\StreamInterface`
- `Guzzle\Http\EntityBody` is now `GuzzleHttp\Stream\Stream`
- `Guzzle\Http\CachingEntityBody` is now `GuzzleHttp\Stream\CachingStream`
- `Guzzle\Http\ReadLimitEntityBody` is now `GuzzleHttp\Stream\LimitStream`
- `Guzzle\Http\IoEmittyinEntityBody` has been removed.

#### Request lifecycle events

Requests previously submitted a large number of requests. The number of events
emitted over the lifecycle of a request has been significantly reduced to make
it easier to understand how to extend the behavior of a request. All events
emitted during the lifecycle of a request now emit a custom
`GuzzleHttp\Event\EventInterface` object that contains context providing
methods and a way in which to modify the transaction at that specific point in
time (e.g., intercept the request and set a response on the transaction).

- `request.before_send` has been renamed to `before` and now emits a
  `GuzzleHttp\Event\BeforeEvent`
- `request.complete` has been renamed to `complete` and now emits a
  `GuzzleHttp\Event\CompleteEvent`.
- `request.sent` has been removed. Use `complete`.
- `request.success` has been removed. Use `complete`.
- `error` is now an event that emits a `GuzzleHttp\Event\ErrorEvent`.
- `request.exception` has been removed. Use `error`.
- `request.receive.status_line` has been removed.
- `curl.callback.progress` has been removed. Use a custom `StreamInterface` to
  maintain a status update.
- `curl.callback.write` has been removed. Use a custom `StreamInterface` to
  intercept writes.
- `curl.callback.read` has been removed. Use a custom `StreamInterface` to
  intercept reads.

`headers` is a new event that is emitted after the response headers of a
request have been received before the body of the response is downloaded. This
event emits a `GuzzleHttp\Event\HeadersEvent`.

You can intercept a request and inject a response using the `intercept()` event
of a `GuzzleHttp\Event\BeforeEvent`, `GuzzleHttp\Event\CompleteEvent`, and
`GuzzleHttp\Event\ErrorEvent` event.

See: https://docs.guzzlephp.org/en/latest/events.html

## Inflection

The `Guzzle\Inflection` namespace has been removed. This is not a core concern
of Guzzle.

## Iterator

The `Guzzle\Iterator` namespace has been removed.

- `Guzzle\Iterator\AppendIterator`, `Guzzle\Iterator\ChunkedIterator`, and
  `Guzzle\Iterator\MethodProxyIterator` are nice, but not a core requirement of
  Guzzle itself.
- `Guzzle\Iterator\FilterIterator` is no longer needed because an equivalent
  class is shipped with PHP 5.4.
- `Guzzle\Iterator\MapIterator` is not really needed when using PHP 5.5 because
  it's easier to just wrap an iterator in a generator that maps values.

For a replacement of these iterators, see https://github.com/nikic/iter

## Log

The LogPlugin has moved to https://github.com/guzzle/log-subscriber. The
`Guzzle\Log` namespace has been removed. Guzzle now relies on
`Psr\Log\LoggerInterface` for all logging. The MessageFormatter class has been
moved to `GuzzleHttp\Subscriber\Log\Formatter`.

## Parser

The `Guzzle\Parser` namespace has been removed. This was previously used to
make it possible to plug in custom parsers for cookies, messages, URI
templates, and URLs; however, this level of complexity is not needed in Guzzle
so it has been removed.

- Cookie: Cookie parsing logic has been moved to
  `GuzzleHttp\Cookie\SetCookie::fromString`.
- Message: Message parsing logic for both requests and responses has been moved
  to `GuzzleHttp\Message\MessageFactory::fromMessage`. Message parsing is only
  used in debugging or deserializing messages, so it doesn't make sense for
  Guzzle as a library to add this level of complexity to parsing messages.
- UriTemplate: URI template parsing has been moved to
  `GuzzleHttp\UriTemplate`. The Guzzle library will automatically use the PECL
  URI template library if it is installed.
- Url: URL parsing is now performed in `GuzzleHttp\Url::fromString` (previously
  it was `Guzzle\Http\Url::factory()`). If custom URL parsing is necessary,
  then developers are free to subclass `GuzzleHttp\Url`.

## Plugin

The `Guzzle\Plugin` namespace has been renamed to `GuzzleHttp\Subscriber`.
Several plugins are shipping with the core Guzzle library under this namespace.

- `GuzzleHttp\Subscriber\Cookie`: Replaces the old CookiePlugin. Cookie jar
  code has moved to `GuzzleHttp\Cookie`.
- `GuzzleHttp\Subscriber\History`: Replaces the old HistoryPlugin.
- `GuzzleHttp\Subscriber\HttpError`: Throws errors when a bad HTTP response is
  received.
- `GuzzleHttp\Subscriber\Mock`: Replaces the old MockPlugin.
- `GuzzleHttp\Subscriber\Prepare`: Prepares the body of a request just before
  sending. This subscriber is attached to all requests by default.
- `GuzzleHttp\Subscriber\Redirect`: Replaces the RedirectPlugin.

The following plugins have been removed (third-parties are free to re-implement
these if needed):

- `GuzzleHttp\Plugin\Async` has been removed.
- `GuzzleHttp\Plugin\CurlAuth` has been removed.
- `GuzzleHttp\Plugin\ErrorResponse\ErrorResponsePlugin` has been removed. This
  functionality should instead be implemented with event listeners that occur
  after normal response parsing occurs in the guzzle/command package.

The following plugins are not part of the core Guzzle package, but are provided
in separate repositories:

- `Guzzle\Http\Plugin\BackoffPlugin` has been rewritten to be much simpler
  to build custom retry policies using simple functions rather than various
  chained classes. See: https://github.com/guzzle/retry-subscriber
- `Guzzle\Http\Plugin\Cache\CachePlugin` has moved to
  https://github.com/guzzle/cache-subscriber
- `Guzzle\Http\Plugin\Log\LogPlugin` has moved to
  https://github.com/guzzle/log-subscriber
- `Guzzle\Http\Plugin\Md5\Md5Plugin` has moved to
  https://github.com/guzzle/message-integrity-subscriber
- `Guzzle\Http\Plugin\Mock\MockPlugin` has moved to
  `GuzzleHttp\Subscriber\MockSubscriber`.
- `Guzzle\Http\Plugin\Oauth\OauthPlugin` has moved to
  https://github.com/guzzle/oauth-subscriber

## Service

The service description layer of Guzzle has moved into two separate packages:

- https://github.com/guzzle/command Provides a high level abstraction over web
  services by representing web service operations using commands.
- https://github.com/guzzle/guzzle-services Provides an implementation of
  guzzle/command that provides request serialization and response parsing using
  Guzzle service descriptions.

## Stream

Stream have moved to a separate package available at
https://github.com/guzzle/streams.

`Guzzle\Stream\StreamInterface` has been given a large update to cleanly take
on the responsibilities of `Guzzle\Http\EntityBody` and
`Guzzle\Http\EntityBodyInterface` now that they have been removed. The number
of methods implemented by the `StreamInterface` has been drastically reduced to
allow developers to more easily extend and decorate stream behavior.

## Removed methods from StreamInterface

- `getStream` and `setStream` have been removed to better encapsulate streams.
- `getMetadata` and `setMetadata` have been removed in favor of
  `GuzzleHttp\Stream\MetadataStreamInterface`.
- `getWrapper`, `getWrapperData`, `getStreamType`, and `getUri` have all been
  removed. This data is accessible when
  using streams that implement `GuzzleHttp\Stream\MetadataStreamInterface`.
- `rewind` has been removed. Use `seek(0)` for a similar behavior.

## Renamed methods

- `detachStream` has been renamed to `detach`.
- `feof` has been renamed to `eof`.
- `ftell` has been renamed to `tell`.
- `readLine` has moved from an instance method to a static class method of
  `GuzzleHttp\Stream\Stream`.

## Metadata streams

`GuzzleHttp\Stream\MetadataStreamInterface` has been added to denote streams
that contain additional metadata accessible via `getMetadata()`.
`GuzzleHttp\Stream\StreamInterface::getMetadata` and
`GuzzleHttp\Stream\StreamInterface::setMetadata` have been removed.

## StreamRequestFactory

The entire concept of the StreamRequestFactory has been removed. The way this
was used in Guzzle 3 broke the actual interface of sending streaming requests
(instead of getting back a Response, you got a StreamInterface). Streaming
PHP requests are now implemented through the `GuzzleHttp\Adapter\StreamAdapter`.

3.6 to 3.7
----------

### Deprecations

- You can now enable E_USER_DEPRECATED warnings to see if you are using any deprecated methods.:

```php
\Guzzle\Common\Version::$emitWarnings = true;
```

The following APIs and options have been marked as deprecated:

- Marked `Guzzle\Http\Message\Request::isResponseBodyRepeatable()` as deprecated. Use `$request->getResponseBody()->isRepeatable()` instead.
- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
- Marked `Guzzle\Http\Message\Request::canCache()` as deprecated. Use `Guzzle\Plugin\Cache\DefaultCanCacheStrategy->canCacheRequest()` instead.
- Marked `Guzzle\Http\Message\Request::setIsRedirect()` as deprecated. Use the HistoryPlugin instead.
- Marked `Guzzle\Http\Message\Request::isRedirect()` as deprecated. Use the HistoryPlugin instead.
- Marked `Guzzle\Cache\CacheAdapterFactory::factory()` as deprecated
- Marked `Guzzle\Service\Client::enableMagicMethods()` as deprecated. Magic methods can no longer be disabled on a Guzzle\Service\Client.
- Marked `Guzzle\Parser\Url\UrlParser` as deprecated. Just use PHP's `parse_url()` and percent encode your UTF-8.
- Marked `Guzzle\Common\Collection::inject()` as deprecated.
- Marked `Guzzle\Plugin\CurlAuth\CurlAuthPlugin` as deprecated. Use
  `$client->getConfig()->setPath('request.options/auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));` or
  `$client->setDefaultOption('auth', array('user', 'pass', 'Basic|Digest|NTLM|Any'));`

3.7 introduces `request.options` as a parameter for a client configuration and as an optional argument to all creational
request methods. When paired with a client's configuration settings, these options allow you to specify default settings
for various aspects of a request. Because these options make other previous configuration options redundant, several
configuration options and methods of a client and AbstractCommand have been deprecated.

- Marked `Guzzle\Service\Client::getDefaultHeaders()` as deprecated. Use `$client->getDefaultOption('headers')`.
- Marked `Guzzle\Service\Client::setDefaultHeaders()` as deprecated. Use `$client->setDefaultOption('headers/{header_name}', 'value')`.
- Marked 'request.params' for `Guzzle\Http\Client` as deprecated. Use `$client->setDefaultOption('params/{param_name}', 'value')`
- Marked 'command.headers', 'command.response_body' and 'command.on_complete' as deprecated for AbstractCommand. These will work through Guzzle 4.0

        $command = $client->getCommand('foo', array(
            'command.headers' => array('Test' => '123'),
            'command.response_body' => '/path/to/file'
        ));

        // Should be changed to:

        $command = $client->getCommand('foo', array(
            'command.request_options' => array(
                'headers' => array('Test' => '123'),
                'save_as' => '/path/to/file'
            )
        ));

### Interface changes

Additions and changes (you will need to update any implementations or subclasses you may have created):

- Added an `$options` argument to the end of the following methods of `Guzzle\Http\ClientInterface`:
  createRequest, head, delete, put, patch, post, options, prepareRequest
- Added an `$options` argument to the end of `Guzzle\Http\Message\Request\RequestFactoryInterface::createRequest()`
- Added an `applyOptions()` method to `Guzzle\Http\Message\Request\RequestFactoryInterface`
- Changed `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $body = null)` to
  `Guzzle\Http\ClientInterface::get($uri = null, $headers = null, $options = array())`. You can still pass in a
  resource, string, or EntityBody into the $options parameter to specify the download location of the response.
- Changed `Guzzle\Common\Collection::__construct($data)` to no longer accepts a null value for `$data` but a
  default `array()`
- Added `Guzzle\Stream\StreamInterface::isRepeatable`
- Made `Guzzle\Http\Client::expandTemplate` and `getUriTemplate` protected methods.

The following methods were removed from interfaces. All of these methods are still available in the concrete classes
that implement them, but you should update your code to use alternative methods:

- Removed `Guzzle\Http\ClientInterface::setDefaultHeaders(). Use
  `$client->getConfig()->setPath('request.options/headers/{header_name}', 'value')`. or
  `$client->getConfig()->setPath('request.options/headers', array('header_name' => 'value'))` or
  `$client->setDefaultOption('headers/{header_name}', 'value')`. or
  `$client->setDefaultOption('headers', array('header_name' => 'value'))`.
- Removed `Guzzle\Http\ClientInterface::getDefaultHeaders(). Use `$client->getConfig()->getPath('request.options/headers')`.
- Removed `Guzzle\Http\ClientInterface::expandTemplate()`. This is an implementation detail.
- Removed `Guzzle\Http\ClientInterface::setRequestFactory()`. This is an implementation detail.
- Removed `Guzzle\Http\ClientInterface::getCurlMulti()`. This is a very specific implementation detail.
- Removed `Guzzle\Http\Message\RequestInterface::canCache`. Use the CachePlugin.
- Removed `Guzzle\Http\Message\RequestInterface::setIsRedirect`. Use the HistoryPlugin.
- Removed `Guzzle\Http\Message\RequestInterface::isRedirect`. Use the HistoryPlugin.

### Cache plugin breaking changes

- CacheKeyProviderInterface and DefaultCacheKeyProvider are no longer used. All of this logic is handled in a
  CacheStorageInterface. These two objects and interface will be removed in a future version.
- Always setting X-cache headers on cached responses
- Default cache TTLs are now handled by the CacheStorageInterface of a CachePlugin
- `CacheStorageInterface::cache($key, Response $response, $ttl = null)` has changed to `cache(RequestInterface
  $request, Response $response);`
- `CacheStorageInterface::fetch($key)` has changed to `fetch(RequestInterface $request);`
- `CacheStorageInterface::delete($key)` has changed to `delete(RequestInterface $request);`
- Added `CacheStorageInterface::purge($url)`
- `DefaultRevalidation::__construct(CacheKeyProviderInterface $cacheKey, CacheStorageInterface $cache, CachePlugin
  $plugin)` has changed to `DefaultRevalidation::__construct(CacheStorageInterface $cache,
  CanCacheStrategyInterface $canCache = null)`
- Added `RevalidationInterface::shouldRevalidate(RequestInterface $request, Response $response)`

3.5 to 3.6
----------

* Mixed casing of headers are now forced to be a single consistent casing across all values for that header.
* Messages internally use a HeaderCollection object to delegate handling case-insensitive header resolution
* Removed the whole changedHeader() function system of messages because all header changes now go through addHeader().
  For example, setHeader() first removes the header using unset on a HeaderCollection and then calls addHeader().
  Keeping the Host header and URL host in sync is now handled by overriding the addHeader method in Request.
* Specific header implementations can be created for complex headers. When a message creates a header, it uses a
  HeaderFactory which can map specific headers to specific header classes. There is now a Link header and
  CacheControl header implementation.
* Moved getLinks() from Response to just be used on a Link header object.

If you previously relied on Guzzle\Http\Message\Header::raw(), then you will need to update your code to use the
HeaderInterface (e.g. toArray(), getAll(), etc.).

### Interface changes

* Removed from interface: Guzzle\Http\ClientInterface::setUriTemplate
* Removed from interface: Guzzle\Http\ClientInterface::setCurlMulti()
* Removed Guzzle\Http\Message\Request::receivedRequestHeader() and implemented this functionality in
  Guzzle\Http\Curl\RequestMediator
* Removed the optional $asString parameter from MessageInterface::getHeader(). Just cast the header to a string.
* Removed the optional $tryChunkedTransfer option from Guzzle\Http\Message\EntityEnclosingRequestInterface
* Removed the $asObjects argument from Guzzle\Http\Message\MessageInterface::getHeaders()

### Removed deprecated functions

* Removed Guzzle\Parser\ParserRegister::get(). Use getParser()
* Removed Guzzle\Parser\ParserRegister::set(). Use registerParser().

### Deprecations

* The ability to case-insensitively search for header values
* Guzzle\Http\Message\Header::hasExactHeader
* Guzzle\Http\Message\Header::raw. Use getAll()
* Deprecated cache control specific methods on Guzzle\Http\Message\AbstractMessage. Use the CacheControl header object
  instead.

### Other changes

* All response header helper functions return a string rather than mixing Header objects and strings inconsistently
* Removed cURL blacklist support. This is no longer necessary now that Expect, Accept, etc. are managed by Guzzle
  directly via interfaces
* Removed the injecting of a request object onto a response object. The methods to get and set a request still exist
  but are a no-op until removed.
* Most classes that used to require a `Guzzle\Service\Command\CommandInterface` typehint now request a
  `Guzzle\Service\Command\ArrayCommandInterface`.
* Added `Guzzle\Http\Message\RequestInterface::startResponse()` to the RequestInterface to handle injecting a response
  on a request while the request is still being transferred
* `Guzzle\Service\Command\CommandInterface` now extends from ToArrayInterface and ArrayAccess

3.3 to 3.4
----------

Base URLs of a client now follow the rules of https://datatracker.ietf.org/doc/html/rfc3986#section-5.2.2 when merging URLs.

3.2 to 3.3
----------

### Response::getEtag() quote stripping removed

`Guzzle\Http\Message\Response::getEtag()` no longer strips quotes around the ETag response header

### Removed `Guzzle\Http\Utils`

The `Guzzle\Http\Utils` class was removed. This class was only used for testing.

### Stream wrapper and type

`Guzzle\Stream\Stream::getWrapper()` and `Guzzle\Stream\Stream::getStreamType()` are no longer converted to lowercase.

### curl.emit_io became emit_io

Emitting IO events from a RequestMediator is now a parameter that must be set in a request's curl options using the
'emit_io' key. This was previously set under a request's parameters using 'curl.emit_io'

3.1 to 3.2
----------

### CurlMulti is no longer reused globally

Before 3.2, the same CurlMulti object was reused globally for each client. This can cause issue where plugins added
to a single client can pollute requests dispatched from other clients.

If you still wish to reuse the same CurlMulti object with each client, then you can add a listener to the
ServiceBuilder's `service_builder.create_client` event to inject a custom CurlMulti object into each client as it is
created.

```php
$multi = new Guzzle\Http\Curl\CurlMulti();
$builder = Guzzle\Service\Builder\ServiceBuilder::factory('/path/to/config.json');
$builder->addListener('service_builder.create_client', function ($event) use ($multi) {
    $event['client']->setCurlMulti($multi);
}
});
```

### No default path

URLs no longer have a default path value of '/' if no path was specified.

Before:

```php
$request = $client->get('http://www.foo.com');
echo $request->getUrl();
// >> http://www.foo.com/
```

After:

```php
$request = $client->get('http://www.foo.com');
echo $request->getUrl();
// >> http://www.foo.com
```

### Less verbose BadResponseException

The exception message for `Guzzle\Http\Exception\BadResponseException` no longer contains the full HTTP request and
response information. You can, however, get access to the request and response object by calling `getRequest()` or
`getResponse()` on the exception object.

### Query parameter aggregation

Multi-valued query parameters are no longer aggregated using a callback function. `Guzzle\Http\Query` now has a
setAggregator() method that accepts a `Guzzle\Http\QueryAggregator\QueryAggregatorInterface` object. This object is
responsible for handling the aggregation of multi-valued query string variables into a flattened hash.

2.8 to 3.x
----------

### Guzzle\Service\Inspector

Change `\Guzzle\Service\Inspector::fromConfig` to `\Guzzle\Common\Collection::fromConfig`

**Before**

```php
use Guzzle\Service\Inspector;

class YourClient extends \Guzzle\Service\Client
{
    public static function factory($config = array())
    {
        $default = array();
        $required = array('base_url', 'username', 'api_key');
        $config = Inspector::fromConfig($config, $default, $required);

        $client = new self(
            $config->get('base_url'),
            $config->get('username'),
            $config->get('api_key')
        );
        $client->setConfig($config);

        $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));

        return $client;
    }
```

**After**

```php
use Guzzle\Common\Collection;

class YourClient extends \Guzzle\Service\Client
{
    public static function factory($config = array())
    {
        $default = array();
        $required = array('base_url', 'username', 'api_key');
        $config = Collection::fromConfig($config, $default, $required);

        $client = new self(
            $config->get('base_url'),
            $config->get('username'),
            $config->get('api_key')
        );
        $client->setConfig($config);

        $client->setDescription(ServiceDescription::factory(__DIR__ . DIRECTORY_SEPARATOR . 'client.json'));

        return $client;
    }
```

### Convert XML Service Descriptions to JSON

**Before**

```xml
<?xml version="1.0" encoding="UTF-8"?>
<client>
    <commands>
        <!-- Groups -->
        <command name="list_groups" method="GET" uri="groups.json">
            <doc>Get a list of groups</doc>
        </command>
        <command name="search_groups" method="GET" uri='search.json?query="{{query}} type:group"'>
            <doc>Uses a search query to get a list of groups</doc>
            <param name="query" type="string" required="true" />
        </command>
        <command name="create_group" method="POST" uri="groups.json">
            <doc>Create a group</doc>
            <param name="data" type="array" location="body" filters="json_encode" doc="Group JSON"/>
            <param name="Content-Type" location="header" static="application/json"/>
        </command>
        <command name="delete_group" method="DELETE" uri="groups/{{id}}.json">
            <doc>Delete a group by ID</doc>
            <param name="id" type="integer" required="true"/>
        </command>
        <command name="get_group" method="GET" uri="groups/{{id}}.json">
            <param name="id" type="integer" required="true"/>
        </command>
        <command name="update_group" method="PUT" uri="groups/{{id}}.json">
            <doc>Update a group</doc>
            <param name="id" type="integer" required="true"/>
            <param name="data" type="array" location="body" filters="json_encode" doc="Group JSON"/>
            <param name="Content-Type" location="header" static="application/json"/>
        </command>
    </commands>
</client>
```

**After**

```json
{
    "name":       "Zendesk REST API v2",
    "apiVersion": "2012-12-31",
    "description":"Provides access to Zendesk views, groups, tickets, ticket fields, and users",
    "operations": {
        "list_groups":  {
            "httpMethod":"GET",
            "uri":       "groups.json",
            "summary":   "Get a list of groups"
        },
        "search_groups":{
            "httpMethod":"GET",
            "uri":       "search.json?query=\"{query} type:group\"",
            "summary":   "Uses a search query to get a list of groups",
            "parameters":{
                "query":{
                    "location":   "uri",
                    "description":"Zendesk Search Query",
                    "type":       "string",
                    "required":   true
                }
            }
        },
        "create_group": {
            "httpMethod":"POST",
            "uri":       "groups.json",
            "summary":   "Create a group",
            "parameters":{
                "data":        {
                    "type":       "array",
                    "location":   "body",
                    "description":"Group JSON",
                    "filters":    "json_encode",
                    "required":   true
                },
                "Content-Type":{
                    "type":    "string",
                    "location":"header",
                    "static":  "application/json"
                }
            }
        },
        "delete_group": {
            "httpMethod":"DELETE",
            "uri":       "groups/{id}.json",
            "summary":   "Delete a group",
            "parameters":{
                "id":{
                    "location":   "uri",
                    "description":"Group to delete by ID",
                    "type":       "integer",
                    "required":   true
                }
            }
        },
        "get_group":    {
            "httpMethod":"GET",
            "uri":       "groups/{id}.json",
            "summary":   "Get a ticket",
            "parameters":{
                "id":{
                    "location":   "uri",
                    "description":"Group to get by ID",
                    "type":       "integer",
                    "required":   true
                }
            }
        },
        "update_group": {
            "httpMethod":"PUT",
            "uri":       "groups/{id}.json",
            "summary":   "Update a group",
            "parameters":{
                "id":          {
                    "location":   "uri",
                    "description":"Group to update by ID",
                    "type":       "integer",
                    "required":   true
                },
                "data":        {
                    "type":       "array",
                    "location":   "body",
                    "description":"Group JSON",
                    "filters":    "json_encode",
                    "required":   true
                },
                "Content-Type":{
                    "type":    "string",
                    "location":"header",
                    "static":  "application/json"
                }
            }
        }
}
```

### Guzzle\Service\Description\ServiceDescription

Commands are now called Operations

**Before**

```php
use Guzzle\Service\Description\ServiceDescription;

$sd = new ServiceDescription();
$sd->getCommands();     // @returns ApiCommandInterface[]
$sd->hasCommand($name);
$sd->getCommand($name); // @returns ApiCommandInterface|null
$sd->addCommand($command); // @param ApiCommandInterface $command
```

**After**

```php
use Guzzle\Service\Description\ServiceDescription;

$sd = new ServiceDescription();
$sd->getOperations();           // @returns OperationInterface[]
$sd->hasOperation($name);
$sd->getOperation($name);       // @returns OperationInterface|null
$sd->addOperation($operation);  // @param OperationInterface $operation
```

### Guzzle\Common\Inflection\Inflector

Namespace is now `Guzzle\Inflection\Inflector`

### Guzzle\Http\Plugin

Namespace is now `Guzzle\Plugin`. Many other changes occur within this namespace and are detailed in their own sections below.

### Guzzle\Http\Plugin\LogPlugin and Guzzle\Common\Log

Now `Guzzle\Plugin\Log\LogPlugin` and `Guzzle\Log` respectively.

**Before**

```php
use Guzzle\Common\Log\ClosureLogAdapter;
use Guzzle\Http\Plugin\LogPlugin;

/** @var \Guzzle\Http\Client */
$client;

// $verbosity is an integer indicating desired message verbosity level
$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $verbosity = LogPlugin::LOG_VERBOSE);
```

**After**

```php
use Guzzle\Log\ClosureLogAdapter;
use Guzzle\Log\MessageFormatter;
use Guzzle\Plugin\Log\LogPlugin;

/** @var \Guzzle\Http\Client */
$client;

// $format is a string indicating desired message format -- @see MessageFormatter
$client->addSubscriber(new LogPlugin(new ClosureLogAdapter(function($m) { echo $m; }, $format = MessageFormatter::DEBUG_FORMAT);
```

### Guzzle\Http\Plugin\CurlAuthPlugin

Now `Guzzle\Plugin\CurlAuth\CurlAuthPlugin`.

### Guzzle\Http\Plugin\ExponentialBackoffPlugin

Now `Guzzle\Plugin\Backoff\BackoffPlugin`, and other changes.

**Before**

```php
use Guzzle\Http\Plugin\ExponentialBackoffPlugin;

$backoffPlugin = new ExponentialBackoffPlugin($maxRetries, array_merge(
        ExponentialBackoffPlugin::getDefaultFailureCodes(), array(429)
    ));

$client->addSubscriber($backoffPlugin);
```

**After**

```php
use Guzzle\Plugin\Backoff\BackoffPlugin;
use Guzzle\Plugin\Backoff\HttpBackoffStrategy;

// Use convenient factory method instead -- see implementation for ideas of what
// you can do with chaining backoff strategies
$backoffPlugin = BackoffPlugin::getExponentialBackoff($maxRetries, array_merge(
        HttpBackoffStrategy::getDefaultFailureCodes(), array(429)
    ));
$client->addSubscriber($backoffPlugin);
```

### Known Issues

#### [BUG] Accept-Encoding header behavior changed unintentionally.

(See #217) (Fixed in 09daeb8c666fb44499a0646d655a8ae36456575e)

In version 2.8 setting the `Accept-Encoding` header would set the CURLOPT_ENCODING option, which permitted cURL to
properly handle gzip/deflate compressed responses from the server. In versions affected by this bug this does not happen.
See issue #217 for a workaround, or use a version containing the fix.


================================================
FILE: composer.json
================================================
{
    "name": "guzzlehttp/guzzle",
    "description": "Guzzle is a PHP HTTP client library",
    "keywords": [
        "framework",
        "http",
        "rest",
        "web service",
        "curl",
        "client",
        "HTTP client",
        "PSR-7",
        "PSR-18"
    ],
    "license": "MIT",
    "authors": [
        {
            "name": "Graham Campbell",
            "email": "hello@gjcampbell.co.uk",
            "homepage": "https://github.com/GrahamCampbell"
        },
        {
            "name": "Michael Dowling",
            "email": "mtdowling@gmail.com",
            "homepage": "https://github.com/mtdowling"
        },
        {
            "name": "Jeremy Lindblom",
            "email": "jeremeamia@gmail.com",
            "homepage": "https://github.com/jeremeamia"
        },
        {
            "name": "George Mponos",
            "email": "gmponos@gmail.com",
            "homepage": "https://github.com/gmponos"
        },
        {
            "name": "Tobias Nyholm",
            "email": "tobias.nyholm@gmail.com",
            "homepage": "https://github.com/Nyholm"
        },
        {
            "name": "Márk Sági-Kazár",
            "email": "mark.sagikazar@gmail.com",
            "homepage": "https://github.com/sagikazarmark"
        },
        {
            "name": "Tobias Schultze",
            "email": "webmaster@tubo-world.de",
            "homepage": "https://github.com/Tobion"
        }
    ],
    "repositories": [
        {
            "type": "package",
            "package": {
                "name": "guzzle/client-integration-tests",
                "version": "v3.0.2",
                "dist": {
                    "url": "https://codeload.github.com/guzzle/client-integration-tests/zip/2c025848417c1135031fdf9c728ee53d0a7ceaee",
                    "type": "zip"
                },
                "require": {
                    "php": "^7.2.5 || ^8.0",
                    "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.11",
                    "php-http/message": "^1.0 || ^2.0",
                    "guzzlehttp/psr7": "^1.7 || ^2.0",
                    "th3n3rd/cartesian-product": "^0.3"
                },
                "autoload": {
                    "psr-4": {
                        "Http\\Client\\Tests\\": "src/"
                    }
                },
                "bin": [
                    "bin/http_test_server"
                ]
            }
        }
    ],
    "require": {
        "php": "^7.2.5 || ^8.0",
        "ext-json": "*",
        "guzzlehttp/promises": "^2.3",
        "guzzlehttp/psr7": "^2.8",
        "psr/http-client": "^1.0",
        "symfony/deprecation-contracts": "^2.2 || ^3.0"
    },
    "provide": {
        "psr/http-client-implementation": "1.0"
    },
    "require-dev": {
        "ext-curl": "*",
        "bamarni/composer-bin-plugin": "^1.8.2",
        "guzzle/client-integration-tests": "3.0.2",
        "php-http/message-factory": "^1.1",
        "phpunit/phpunit": "^8.5.39 || ^9.6.20",
        "psr/log": "^1.1 || ^2.0 || ^3.0"
    },
    "suggest": {
        "ext-curl": "Required for CURL handler support",
        "ext-intl": "Required for Internationalized Domain Name (IDN) support",
        "psr/log": "Required for using the Log middleware"
    },
    "config": {
        "allow-plugins": {
            "bamarni/composer-bin-plugin": true
        },
        "preferred-install": "dist",
        "sort-packages": true
    },
    "extra": {
        "bamarni-bin": {
            "bin-links": true,
            "forward-command": false
        }
    },
    "autoload": {
        "psr-4": {
            "GuzzleHttp\\": "src/"
        },
        "files": [
            "src/functions_include.php"
        ]
    },
    "autoload-dev": {
        "psr-4": {
            "GuzzleHttp\\Tests\\": "tests/"
        }
    }
}


================================================
FILE: docs/Makefile
================================================
# Makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS    =
SPHINXBUILD   = sphinx-build
PAPER         =
BUILDDIR      = _build

# Internal variables.
PAPEROPT_a4     = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .

.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext

help:
	@echo "Please use \`make <target>' where <target> is one of"
	@echo "  html       to make standalone HTML files"
	@echo "  dirhtml    to make HTML files named index.html in directories"
	@echo "  singlehtml to make a single large HTML file"
	@echo "  pickle     to make pickle files"
	@echo "  json       to make JSON files"
	@echo "  htmlhelp   to make HTML files and a HTML help project"
	@echo "  qthelp     to make HTML files and a qthelp project"
	@echo "  devhelp    to make HTML files and a Devhelp project"
	@echo "  epub       to make an epub"
	@echo "  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
	@echo "  latexpdf   to make LaTeX files and run them through pdflatex"
	@echo "  text       to make text files"
	@echo "  man        to make manual pages"
	@echo "  texinfo    to make Texinfo files"
	@echo "  info       to make Texinfo files and run them through makeinfo"
	@echo "  gettext    to make PO message catalogs"
	@echo "  changes    to make an overview of all changed/added/deprecated items"
	@echo "  linkcheck  to check all external links for integrity"
	@echo "  doctest    to run all doctests embedded in the documentation (if enabled)"

clean:
	-rm -rf $(BUILDDIR)/*

html:
	$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."

dirhtml:
	$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
	@echo
	@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."

singlehtml:
	$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
	@echo
	@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."

pickle:
	$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
	@echo
	@echo "Build finished; now you can process the pickle files."

json:
	$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
	@echo
	@echo "Build finished; now you can process the JSON files."

htmlhelp:
	$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
	@echo
	@echo "Build finished; now you can run HTML Help Workshop with the" \
	      ".hhp project file in $(BUILDDIR)/htmlhelp."

qthelp:
	$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
	@echo
	@echo "Build finished; now you can run "qcollectiongenerator" with the" \
	      ".qhcp project file in $(BUILDDIR)/qthelp, like this:"
	@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/Guzzle.qhcp"
	@echo "To view the help file:"
	@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/Guzzle.qhc"

devhelp:
	$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
	@echo
	@echo "Build finished."
	@echo "To view the help file:"
	@echo "# mkdir -p $$HOME/.local/share/devhelp/Guzzle"
	@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/Guzzle"
	@echo "# devhelp"

epub:
	$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
	@echo
	@echo "Build finished. The epub file is in $(BUILDDIR)/epub."

latex:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo
	@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
	@echo "Run \`make' in that directory to run these through (pdf)latex" \
	      "(use \`make latexpdf' here to do that automatically)."

latexpdf:
	$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
	@echo "Running LaTeX files through pdflatex..."
	$(MAKE) -C $(BUILDDIR)/latex all-pdf
	@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."

text:
	$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
	@echo
	@echo "Build finished. The text files are in $(BUILDDIR)/text."

man:
	$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
	@echo
	@echo "Build finished. The manual pages are in $(BUILDDIR)/man."

texinfo:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo
	@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
	@echo "Run \`make' in that directory to run these through makeinfo" \
	      "(use \`make info' here to do that automatically)."

info:
	$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
	@echo "Running Texinfo files through makeinfo..."
	make -C $(BUILDDIR)/texinfo info
	@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."

gettext:
	$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
	@echo
	@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."

changes:
	$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
	@echo
	@echo "The overview file is in $(BUILDDIR)/changes."

linkcheck:
	$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
	@echo
	@echo "Link check complete; look for any errors in the above output " \
	      "or in $(BUILDDIR)/linkcheck/output.txt."

doctest:
	$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
	@echo "Testing of doctests in the sources finished, look at the " \
	      "results in $(BUILDDIR)/doctest/output.txt."


================================================
FILE: docs/conf.py
================================================
import sys, os
from sphinx.highlighting import lexers
from pygments.lexers.web import PhpLexer


lexers['php'] = PhpLexer(startinline=True, linenos=1)
lexers['php-annotations'] = PhpLexer(startinline=True, linenos=1)
primary_domain = 'php'

extensions = []
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'Guzzle'
copyright = u'2015, Michael Dowling'
version = '7'
html_title = "Guzzle Documentation"
html_short_title = "Guzzle 7"

exclude_patterns = ['_build']
html_static_path = ['_static']

##### Guzzle sphinx theme

import guzzle_sphinx_theme
html_translator_class = 'guzzle_sphinx_theme.HTMLTranslator'
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'

# Custom sidebar templates, maps document names to template names.
html_sidebars = {
    '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
}

# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")

# Guzzle theme options (see theme.conf for more information)
html_theme_options = {

    # Set the path to a special layout to include for the homepage
    # "index_template": "homepage.html",

    # Allow a separate homepage from the master_doc
    # homepage = index

    # Set the name of the project to appear in the nav menu
    # "project_nav_name": "Guzzle",

    # Set your Disqus short name to enable comments
    # "disqus_comments_shortname": "my_disqus_comments_short_name",

    # Set you GA account ID to enable tracking
    # "google_analytics_account": "my_ga_account",

    # Path to a touch icon
    # "touch_icon": "",

    # Specify a base_url used to generate sitemap.xml links. If not
    # specified, then no sitemap will be built.
    "base_url": "http://guzzlephp.org"

    # Allow the "Table of Contents" page to be defined separately from "master_doc"
    # tocpage = Contents

    # Allow the project link to be overriden to a custom URL.
    # projectlink = http://myproject.url
}


================================================
FILE: docs/faq.rst
================================================
===
FAQ
===

Does Guzzle require cURL?
=========================

No. Guzzle can use any HTTP handler to send requests. This means that Guzzle
can be used with cURL, PHP's stream wrapper, sockets, and non-blocking libraries
like `React <https://reactphp.org/>`_. You just need to configure an HTTP handler
to use a different method of sending requests.

.. note::

    Guzzle has historically only utilized cURL to send HTTP requests. cURL is
    an amazing HTTP client (arguably the best), and Guzzle will continue to use
    it by default when it is available. It is rare, but some developers don't
    have cURL installed on their systems or run into version specific issues.
    By allowing swappable HTTP handlers, Guzzle is now much more customizable
    and able to adapt to fit the needs of more developers.


Can Guzzle send asynchronous requests?
======================================

Yes. You can use the ``requestAsync``, ``sendAsync``, ``getAsync``,
``headAsync``, ``putAsync``, ``postAsync``, ``deleteAsync``, and ``patchAsync``
methods of a client to send an asynchronous request. The client will return a
``GuzzleHttp\Promise\PromiseInterface`` object. You can chain ``then``
functions off of the promise.

.. code-block:: php

    $promise = $client->requestAsync('GET', 'http://httpbin.org/get');
    $promise->then(function ($response) {
        echo 'Got a response! ' . $response->getStatusCode();
    });

You can force an asynchronous response to complete using the ``wait()`` method
of the returned promise.

.. code-block:: php

    $promise = $client->requestAsync('GET', 'http://httpbin.org/get');
    $response = $promise->wait();


How can I add custom cURL options?
==================================

cURL offers a huge number of `customizable options <https://www.php.net/curl_setopt>`_.
While Guzzle normalizes many of these options across different handlers, there
are times when you need to set custom cURL options. This can be accomplished
by passing an associative array of cURL settings in the **curl** key of a
request.

For example, let's say you need to customize the outgoing network interface
used with a client.

.. code-block:: php

    $client->request('GET', '/', [
        'curl' => [
            CURLOPT_INTERFACE => 'xxx.xxx.xxx.xxx'
        ]
    ]);

If you use asynchronous requests with cURL multi handler and want to tweak it,
additional options can be specified as an associative array in the
**options** key of the ``CurlMultiHandler`` constructor.

.. code-block:: php

    use GuzzleHttp\Client;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlMultiHandler;

    $client = new Client(['handler' => HandlerStack::create(new CurlMultiHandler([
        'options' => [
            CURLMOPT_MAX_TOTAL_CONNECTIONS => 50,
            CURLMOPT_MAX_HOST_CONNECTIONS => 5,
        ]
    ]))]);


How can I add custom stream context options?
============================================

You can pass custom `stream context options <https://www.php.net/manual/en/context.php>`_
using the **stream_context** key of the request option. The **stream_context**
array is an associative array where each key is a PHP transport, and each value
is an associative array of transport options.

For example, let's say you need to customize the outgoing network interface
used with a client and allow self-signed certificates.

.. code-block:: php

    $client->request('GET', '/', [
        'stream' => true,
        'stream_context' => [
            'ssl' => [
                'allow_self_signed' => true
            ],
            'socket' => [
                'bindto' => 'xxx.xxx.xxx.xxx'
            ]
        ]
    ]);


Why am I getting an SSL verification error?
===========================================

You need to specify the path on disk to the CA bundle used by Guzzle for
verifying the peer certificate. See :ref:`verify-option`.


What is this Maximum function nesting error?
============================================

    Maximum function nesting level of '100' reached, aborting

You could run into this error if you have the XDebug extension installed and
you execute a lot of requests in callbacks. This error message comes
specifically from the XDebug extension. PHP itself does not have a function
nesting limit. Change this setting in your php.ini to increase the limit::

    xdebug.max_nesting_level = 1000


Why am I getting a 417 error response?
======================================

This can occur for a number of reasons, but if you are sending PUT, POST, or
PATCH requests with an ``Expect: 100-Continue`` header, a server that does not
support this header will return a 417 response. You can work around this by
setting the ``expect`` request option to ``false``:

.. code-block:: php

    $client = new GuzzleHttp\Client();

    // Disable the expect header on a single request
    $response = $client->request('PUT', '/', ['expect' => false]);

    // Disable the expect header on all client requests
    $client = new GuzzleHttp\Client(['expect' => false]);

How can I track redirected requests?
====================================

You can enable tracking of redirected URIs and status codes via the
`track_redirects` option. Each redirected URI and status code will be stored in the
``X-Guzzle-Redirect-History`` and the ``X-Guzzle-Redirect-Status-History``
header respectively.

The initial request's URI and the final status code will be excluded from the results.
With this in mind you should be able to easily track a request's full redirect path.

For example, let's say you need to track redirects and provide both results
together in a single report:

.. code-block:: php

    // First you configure Guzzle with redirect tracking and make a request
    $client = new Client([
        RequestOptions::ALLOW_REDIRECTS => [
            'max'             => 10,        // allow at most 10 redirects.
            'strict'          => true,      // use "strict" RFC compliant redirects.
            'referer'         => true,      // add a Referer header
            'track_redirects' => true,
        ],
    ]);
    $initialRequest = '/redirect/3'; // Store the request URI for later use
    $response = $client->request('GET', $initialRequest); // Make your request

    // Retrieve both Redirect History headers
    $redirectUriHistory = $response->getHeader('X-Guzzle-Redirect-History')[0]; // retrieve Redirect URI history
    $redirectCodeHistory = $response->getHeader('X-Guzzle-Redirect-Status-History')[0]; // retrieve Redirect HTTP Status history

    // Add the initial URI requested to the (beginning of) URI history
    array_unshift($redirectUriHistory, $initialRequest);

    // Add the final HTTP status code to the end of HTTP response history
    array_push($redirectCodeHistory, $response->getStatusCode());

    // (Optional) Combine the items of each array into a single result set
    $fullRedirectReport = [];
    foreach ($redirectUriHistory as $key => $value) {
        $fullRedirectReport[$key] = ['location' => $value, 'code' => $redirectCodeHistory[$key]];
    }
    echo json_encode($fullRedirectReport);


================================================
FILE: docs/handlers-and-middleware.rst
================================================
=======================
Handlers and Middleware
=======================

Guzzle clients use a handler and middleware system to send HTTP requests.

Handlers
========

A handler function accepts a ``Psr\Http\Message\RequestInterface`` and array of
request options and returns a ``GuzzleHttp\Promise\PromiseInterface`` that is
fulfilled with a ``Psr\Http\Message\ResponseInterface`` or rejected with an
exception.

You can provide a custom handler to a client using the ``handler`` option of
a client constructor. It is important to understand that several request
options used by Guzzle require that specific middlewares wrap the handler used
by the client. You can ensure that the handler you provide to a client uses the
default middlewares by wrapping the handler in the
``GuzzleHttp\HandlerStack::create(callable $handler = null)`` static method.

.. code-block:: php

    use GuzzleHttp\Client;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlHandler;

    $handler = new CurlHandler();
    $stack = HandlerStack::create($handler); // Wrap w/ middleware
    $client = new Client(['handler' => $stack]);

The ``create`` method adds default handlers to the ``HandlerStack``. When the
``HandlerStack`` is resolved, the handlers will execute in the following order:

1. Sending request:

  1. ``http_errors`` - No op when sending a request. The response status code
     is checked in the response processing when returning a response promise up
     the stack.
  2. ``allow_redirects`` - No op when sending a request. Following redirects
     occurs when a response promise is being returned up the stack.
  3. ``cookies`` - Adds cookies to requests.
  4. ``prepare_body`` - The body of an HTTP request will be prepared (e.g.,
     add default headers like Content-Length, Content-Type, etc.).
  5. <send request with handler>

2. Processing response:

  1. ``prepare_body`` - no op on response processing.
  2. ``cookies`` - extracts response cookies into the cookie jar.
  3. ``allow_redirects`` - Follows redirects.
  4. ``http_errors`` - throws exceptions when the response status code ``>=``
     400.

When provided no ``$handler`` argument, ``GuzzleHttp\HandlerStack::create()``
will choose the most appropriate handler based on the extensions available on
your system.

.. important::

    The handler provided to a client determines how request options are applied
    and utilized for each request sent by a client. For example, if you do not
    have a cookie middleware associated with a client, then setting the
    ``cookies`` request option will have no effect on the request.


Middleware
==========

Middleware augments the functionality of handlers by invoking them in the
process of generating responses. Middleware is implemented as a higher order
function that takes the following form.

.. code-block:: php

    use Psr\Http\Message\RequestInterface;

    function my_middleware()
    {
        return function (callable $handler) {
            return function (RequestInterface $request, array $options) use ($handler) {
                return $handler($request, $options);
            };
        };
    }

Middleware functions return a function that accepts the next handler to invoke.
This returned function then returns another function that acts as a composed
handler-- it accepts a request and options, and returns a promise that is
fulfilled with a response. Your composed middleware can modify the request,
add custom request options, and modify the promise returned by the downstream
handler.

Here's an example of adding a header to each request.

.. code-block:: php

    use Psr\Http\Message\RequestInterface;

    function add_header($header, $value)
    {
        return function (callable $handler) use ($header, $value) {
            return function (
                RequestInterface $request,
                array $options
            ) use ($handler, $header, $value) {
                $request = $request->withHeader($header, $value);
                return $handler($request, $options);
            };
        };
    }

Once a middleware has been created, you can add it to a client by either
wrapping the handler used by the client or by decorating a handler stack.

.. code-block:: php

    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlHandler;
    use GuzzleHttp\Client;

    $stack = new HandlerStack();
    $stack->setHandler(new CurlHandler());
    $stack->push(add_header('X-Foo', 'bar'));
    $client = new Client(['handler' => $stack]);

Now when you send a request, the client will use a handler composed with your
added middleware, adding a header to each request.

Here's an example of creating a middleware that modifies the response of the
downstream handler. This example adds a header to the response.

.. code-block:: php

    use Psr\Http\Message\RequestInterface;
    use Psr\Http\Message\ResponseInterface;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlHandler;
    use GuzzleHttp\Client;

    function add_response_header($header, $value)
    {
        return function (callable $handler) use ($header, $value) {
            return function (
                RequestInterface $request,
                array $options
            ) use ($handler, $header, $value) {
                $promise = $handler($request, $options);
                return $promise->then(
                    function (ResponseInterface $response) use ($header, $value) {
                        return $response->withHeader($header, $value);
                    }
                );
            };
        };
    }

    $stack = new HandlerStack();
    $stack->setHandler(new CurlHandler());
    $stack->push(add_response_header('X-Foo', 'bar'));
    $client = new Client(['handler' => $stack]);

Creating a middleware that modifies a request is made much simpler using the
``GuzzleHttp\Middleware::mapRequest()`` middleware. This middleware accepts
a function that takes the request argument and returns the request to send.

.. code-block:: php

    use Psr\Http\Message\RequestInterface;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlHandler;
    use GuzzleHttp\Client;
    use GuzzleHttp\Middleware;

    $stack = new HandlerStack();
    $stack->setHandler(new CurlHandler());

    $stack->push(Middleware::mapRequest(function (RequestInterface $request) {
        return $request->withHeader('X-Foo', 'bar');
    }));

    $client = new Client(['handler' => $stack]);

Modifying a response is also much simpler using the
``GuzzleHttp\Middleware::mapResponse()`` middleware.

.. code-block:: php

    use Psr\Http\Message\ResponseInterface;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Handler\CurlHandler;
    use GuzzleHttp\Client;
    use GuzzleHttp\Middleware;

    $stack = new HandlerStack();
    $stack->setHandler(new CurlHandler());

    $stack->push(Middleware::mapResponse(function (ResponseInterface $response) {
        return $response->withHeader('X-Foo', 'bar');
    }));

    $client = new Client(['handler' => $stack]);


HandlerStack
============

A handler stack represents a stack of middleware to apply to a base handler
function. You can push middleware to the stack to add to the top of the stack,
and unshift middleware onto the stack to add to the bottom of the stack. When
the stack is resolved, the handler is pushed onto the stack. Each value is
then popped off of the stack, wrapping the previous value popped off of the
stack.

.. code-block:: php

    use GuzzleHttp\Client;
    use GuzzleHttp\HandlerStack;
    use GuzzleHttp\Middleware;
    use GuzzleHttp\Utils;
    use Psr\Http\Message\RequestInterface;

    $stack = new HandlerStack();
    $stack->setHandler(Utils::chooseHandler());

    $stack->push(Middleware::mapRequest(function (RequestInterface $r) {
        echo 'A';
        return $r;
    }));

    $stack->push(Middleware::mapRequest(function (RequestInterface $r) {
        echo 'B';
        return $r;
    }));

    $stack->push(Middleware::mapRequest(function (RequestInterface $r) {
        echo 'C';
        return $r;
    }));

    $client->request('GET', 'http://httpbin.org/');
    // echoes 'ABC';

    $stack->unshift(Middleware::mapRequest(function (RequestInterface $r) {
        echo '0';
        return $r;
    }));

    $client = new Client(['handler' => $stack]);
    $client->request('GET', 'http://httpbin.org/');
    // echoes '0ABC';

You can give middleware a name, which allows you to add middleware before
other named middleware, after other named middleware, or remove middleware
by name.

.. code-block:: php

    use Psr\Http\Message\RequestInterface;
    use GuzzleHttp\Middleware;

    // Add a middleware with a name
    $stack->push(Middleware::mapRequest(function (RequestInterface $r) {
        return $r->withHeader('X-Foo', 'Bar');
    }, 'add_foo'));

    // Add a middleware before a named middleware (unshift before).
    $stack->before('add_foo', Middleware::mapRequest(function (RequestInterface $r) {
        return $r->withHeader('X-Baz', 'Qux');
    }, 'add_baz'));

    // Add a middleware after a named middleware (pushed after).
    $stack->after('add_baz', Middleware::mapRequest(function (RequestInterface $r) {
        return $r->withHeader('X-Lorem', 'Ipsum');
    }));

    // Remove a middleware by name
    $stack->remove('add_foo');


Creating a Handler
==================

As stated earlier, a handler is a function accepts a
``Psr\Http\Message\RequestInterface`` and array of request options and returns
a ``GuzzleHttp\Promise\PromiseInterface`` that is fulfilled with a
``Psr\Http\Message\ResponseInterface`` or rejected with an exception.

A handler is responsible for applying the following :doc:`request-options`.
These request options are a subset of request options called
"transfer options".

- :ref:`cert-option`
- :ref:`connect_timeout-option`
- :ref:`debug-option`
- :ref:`delay-option`
- :ref:`decode_content-option`
- :ref:`expect-option`
- :ref:`proxy-option`
- :ref:`sink-option`
- :ref:`timeout-option`
- :ref:`ssl_key-option`
- :ref:`stream-option`
- :ref:`verify-option`


================================================
FILE: docs/index.rst
================================================
.. title:: Guzzle, PHP HTTP client

====================
Guzzle Documentation
====================

Guzzle is a PHP HTTP client that makes it easy to send HTTP requests and
trivial to integrate with web services.

- Simple interface for building query strings, POST requests, streaming large
  uploads, streaming large downloads, using HTTP cookies, uploading JSON data,
  etc...
- Can send both synchronous and asynchronous requests using the same interface.
- Uses PSR-7 interfaces for requests, responses, and streams. This allows you
  to utilize other PSR-7 compatible libraries with Guzzle.
- Abstracts away the underlying HTTP transport, allowing you to write
  environment and transport agnostic code; i.e., no hard dependency on cURL,
  PHP streams, sockets, or non-blocking event loops.
- Middleware system allows you to augment and compose client behavior.

.. code-block:: php

    $client = new GuzzleHttp\Client();
    $res = $client->request('GET', 'https://api.github.com/user', [
        'auth' => ['user', 'pass']
    ]);
    echo $res->getStatusCode();
    // "200"
    echo $res->getHeader('content-type')[0];
    // 'application/json; charset=utf8'
    echo $res->getBody();
    // {"type":"User"...'

    // Send an asynchronous request.
    $request = new \GuzzleHttp\Psr7\Request('GET', 'http://httpbin.org');
    $promise = $client->sendAsync($request)->then(function ($response) {
        echo 'I completed! ' . $response->getBody();
    });
    $promise->wait();


User Guide
==========

.. toctree::
    :maxdepth: 3

    overview
    quickstart
    request-options
    psr7
    handlers-and-middleware
    testing
    faq


================================================
FILE: docs/overview.rst
================================================
========
Overview
========

Requirements
============

#. PHP 7.2.5
#. To use the PHP stream handler, ``allow_url_fopen`` must be enabled in your
   system's php.ini.
#. To use the cURL handler, you must have a recent version of cURL >= 7.19.4
   compiled with OpenSSL and zlib.

.. note::

    Guzzle no longer requires cURL in order to send HTTP requests. Guzzle will
    use the PHP stream wrapper to send HTTP requests if cURL is not installed.
    Alternatively, you can provide your own HTTP handler used to send requests.
    Keep in mind that cURL is still required for sending concurrent requests.


.. _installation:


Installation
============

The recommended way to install Guzzle is with
`Composer <https://getcomposer.org>`_. Composer is a dependency management tool
for PHP that allows you to declare the dependencies your project needs and
installs them into your project.

.. code-block:: bash

    # Install Composer
    curl -sS https://getcomposer.org/installer | php

You can add Guzzle as a dependency using Composer:

.. code-block:: bash

    composer require guzzlehttp/guzzle:^7.0

Alternatively, you can specify Guzzle as a dependency in your project's
existing composer.json file:

.. code-block:: js

    {
      "require": {
         "guzzlehttp/guzzle": "^7.0"
      }
   }

After installing, you need to require Composer's autoloader:

.. code-block:: php

    require 'vendor/autoload.php';

You can find out more on how to install Composer, configure autoloading, and
other best-practices for defining dependencies at `getcomposer.org <https://getcomposer.org>`_.


Bleeding edge
-------------

During your development, you can keep up with the latest changes on the master
branch by setting the version requirement for Guzzle to ``^7.0@dev``.

.. code-block:: js

   {
      "require": {
         "guzzlehttp/guzzle": "^7.0@dev"
      }
   }


Upgrading
=========
The git repository contains an `upgrade guide`__ that details what changed
between the major versions.

__ https://github.com/guzzle/guzzle/blob/master/UPGRADING.md


License
=======

Licensed using the `MIT license <https://opensource.org/licenses/MIT>`_.

    Copyright (c) 2015 Michael Dowling <https://github.com/mtdowling>

    Permission is hereby granted, free of charge, to any person obtaining a copy
    of this software and associated documentation files (the "Software"), to deal
    in the Software without restriction, including without limitation the rights
    to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    copies of the Software, and to permit persons to whom the Software is
    furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in
    all copies or substantial portions of the Software.

    THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
    OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
    THE SOFTWARE.


Contributing
============


Guidelines
----------

1. Guzzle utilizes PSR-1, PSR-2, PSR-4, and PSR-7.
2. Guzzle is meant to be lean and fast with very few dependencies. This means
   that not every feature request will be accepted.
3. Guzzle has a minimum PHP version requirement of PHP 7.2. Pull requests must
   not require a PHP version greater than PHP 7.2 unless the feature is only
   utilized conditionally and the file can be parsed by PHP 7.2.
4. All pull requests must include unit tests to ensure the change works as
   expected and to prevent regressions.


Running the tests
-----------------

In order to contribute, you'll need to checkout the source from GitHub and
install Guzzle's dependencies using Composer:

.. code-block:: bash

    git clone https://github.com/guzzle/guzzle.git
    cd guzzle && composer install

Guzzle is unit tested with PHPUnit. Run the tests using the Makefile:

.. code-block:: bash

    make test

.. note::

    You'll need to install node.js v8 or newer in order to perform integration
    tests on Guzzle's HTTP handlers.


Reporting a security vulnerability
==================================

We want to ensure that Guzzle is a secure HTTP client library for everyone. If
you've discovered a security vulnerability in Guzzle, we appreciate your help
in disclosing it to us in a `responsible manner <https://en.wikipedia.org/wiki/Responsible_disclosure>`_.

Publicly disclosing a vulnerability can put the entire community at risk. If
you've discovered a security concern, please email us at
security@guzzlephp.org. We'll work with you to make sure that we understand the
scope of the issue, and that we fully address your concern. We consider
correspondence sent to security@guzzlephp.org our highest priority, and work to
address any issues that arise as quickly as possible.

After a security vulnerability has been corrected, a security hotfix release will
be deployed as soon as possible.


================================================
FILE: docs/psr7.rst
================================================
================
Guzzle and PSR-7
================

Guzzle utilizes PSR-7 as the HTTP message interface. This allows Guzzle to work
with any other library that utilizes PSR-7 message interfaces.

Guzzle is an HTTP client that sends HTTP requests to a server and receives HTTP
responses. Both requests and responses are referred to as messages.

Guzzle relies on the ``guzzlehttp/psr7`` Composer package for its message
implementation of PSR-7.

You can create a request using the ``GuzzleHttp\Psr7\Request`` class:

.. code-block:: php

    use GuzzleHttp\Psr7\Request;

    $request = new Request('GET', 'http://httpbin.org/get');

    // You can provide other optional constructor arguments.
    $headers = ['X-Foo' => 'Bar'];
    $body = 'hello!';
    $request = new Request('PUT', 'http://httpbin.org/put', $headers, $body);

You can create a response using the ``GuzzleHttp\Psr7\Response`` class:

.. code-block:: ph
Download .txt
gitextract_1_65s9f1/

├── .editorconfig
├── .gitattributes
├── .github/
│   ├── .editorconfig
│   ├── FUNDING.yml
│   ├── ISSUE_TEMPLATE/
│   │   ├── bug_report.md
│   │   ├── config.yml
│   │   └── feature_request.md
│   ├── stale.yml
│   └── workflows/
│       ├── checks.yml
│       ├── ci.yml
│       └── static.yml
├── .gitignore
├── .php-cs-fixer.dist.php
├── CHANGELOG.md
├── Dockerfile
├── LICENSE
├── Makefile
├── README.md
├── UPGRADING.md
├── composer.json
├── docs/
│   ├── Makefile
│   ├── conf.py
│   ├── faq.rst
│   ├── handlers-and-middleware.rst
│   ├── index.rst
│   ├── overview.rst
│   ├── psr7.rst
│   ├── quickstart.rst
│   ├── request-options.rst
│   ├── requirements.txt
│   └── testing.rst
├── phpstan-baseline.neon
├── phpstan.neon.dist
├── phpunit.xml.dist
├── src/
│   ├── BodySummarizer.php
│   ├── BodySummarizerInterface.php
│   ├── Client.php
│   ├── ClientInterface.php
│   ├── ClientTrait.php
│   ├── Cookie/
│   │   ├── CookieJar.php
│   │   ├── CookieJarInterface.php
│   │   ├── FileCookieJar.php
│   │   ├── SessionCookieJar.php
│   │   └── SetCookie.php
│   ├── Exception/
│   │   ├── BadResponseException.php
│   │   ├── ClientException.php
│   │   ├── ConnectException.php
│   │   ├── GuzzleException.php
│   │   ├── InvalidArgumentException.php
│   │   ├── RequestException.php
│   │   ├── ServerException.php
│   │   ├── TooManyRedirectsException.php
│   │   └── TransferException.php
│   ├── Handler/
│   │   ├── CurlFactory.php
│   │   ├── CurlFactoryInterface.php
│   │   ├── CurlHandler.php
│   │   ├── CurlMultiHandler.php
│   │   ├── EasyHandle.php
│   │   ├── HeaderProcessor.php
│   │   ├── MockHandler.php
│   │   ├── Proxy.php
│   │   └── StreamHandler.php
│   ├── HandlerStack.php
│   ├── MessageFormatter.php
│   ├── MessageFormatterInterface.php
│   ├── Middleware.php
│   ├── Pool.php
│   ├── PrepareBodyMiddleware.php
│   ├── RedirectMiddleware.php
│   ├── RequestOptions.php
│   ├── RetryMiddleware.php
│   ├── TransferStats.php
│   ├── Utils.php
│   ├── functions.php
│   └── functions_include.php
├── tests/
│   ├── ClientTest.php
│   ├── Cookie/
│   │   ├── CookieJarTest.php
│   │   ├── FileCookieJarTest.php
│   │   ├── SessionCookieJarTest.php
│   │   └── SetCookieTest.php
│   ├── Exception/
│   │   ├── BadResponseExceptionTest.php
│   │   ├── ConnectExceptionTest.php
│   │   └── RequestExceptionTest.php
│   ├── Handler/
│   │   ├── CurlFactoryTest.php
│   │   ├── CurlHandlerTest.php
│   │   ├── CurlMultiHandlerTest.php
│   │   ├── EasyHandleTest.php
│   │   ├── MockHandlerTest.php
│   │   ├── Network/
│   │   │   └── StreamHandlerTest.php
│   │   ├── ProxyTest.php
│   │   └── StreamHandlerTest.php
│   ├── HandlerStackTest.php
│   ├── Helpers.php
│   ├── HttplugIntegrationTest.php
│   ├── InternalUtilsTest.php
│   ├── MessageFormatterTest.php
│   ├── MiddlewareTest.php
│   ├── PoolTest.php
│   ├── PrepareBodyMiddlewareTest.php
│   ├── RedirectMiddlewareTest.php
│   ├── RetryMiddlewareTest.php
│   ├── Server.php
│   ├── TestLogger.php
│   ├── TransferStatsTest.php
│   ├── UtilsTest.php
│   ├── bootstrap-phpstan.php
│   ├── bootstrap.php
│   └── server.js
└── vendor-bin/
    ├── php-cs-fixer/
    │   └── composer.json
    └── phpstan/
        └── composer.json
Download .txt
SYMBOL INDEX (760 symbols across 71 files)

FILE: src/BodySummarizer.php
  class BodySummarizer (line 7) | final class BodySummarizer implements BodySummarizerInterface
    method __construct (line 14) | public function __construct(?int $truncateAt = null)
    method summarize (line 22) | public function summarize(MessageInterface $message): ?string

FILE: src/BodySummarizerInterface.php
  type BodySummarizerInterface (line 7) | interface BodySummarizerInterface
    method summarize (line 12) | public function summarize(MessageInterface $message): ?string;

FILE: src/Client.php
  class Client (line 17) | class Client implements ClientInterface, \Psr\Http\Client\ClientInterface
    method __construct (line 57) | public function __construct(array $config = [])
    method __call (line 81) | public function __call($method, $args)
    method sendAsync (line 101) | public function sendAsync(RequestInterface $request, array $options = ...
    method send (line 120) | public function send(RequestInterface $request, array $options = []): ...
    method sendRequest (line 132) | public function sendRequest(RequestInterface $request): ResponseInterface
    method requestAsync (line 153) | public function requestAsync(string $method, $uri = '', array $options...
    method request (line 185) | public function request(string $method, $uri = '', array $options = []...
    method getConfig (line 205) | public function getConfig(?string $option = null)
    method buildUri (line 212) | private function buildUri(UriInterface $uri, array $config): UriInterface
    method configureDefaults (line 229) | private function configureDefaults(array $config): void
    method prepareDefaults (line 283) | private function prepareDefaults(array $options): array
    method transfer (line 326) | private function transfer(RequestInterface $request, array $options): ...
    method applyOptions (line 342) | private function applyOptions(RequestInterface $request, array &$optio...
    method invalidBody (line 475) | private function invalidBody(): InvalidArgumentException

FILE: src/ClientInterface.php
  type ClientInterface (line 14) | interface ClientInterface
    method send (line 30) | public function send(RequestInterface $request, array $options = []): ...
    method sendAsync (line 39) | public function sendAsync(RequestInterface $request, array $options = ...
    method request (line 54) | public function request(string $method, $uri, array $options = []): Re...
    method requestAsync (line 68) | public function requestAsync(string $method, $uri, array $options = []...
    method getConfig (line 83) | public function getConfig(?string $option = null);

FILE: src/ClientTrait.php
  type ClientTrait (line 13) | trait ClientTrait
    method request (line 28) | abstract public function request(string $method, $uri, array $options ...
    method get (line 42) | public function get($uri, array $options = []): ResponseInterface
    method head (line 59) | public function head($uri, array $options = []): ResponseInterface
    method put (line 76) | public function put($uri, array $options = []): ResponseInterface
    method post (line 93) | public function post($uri, array $options = []): ResponseInterface
    method patch (line 110) | public function patch($uri, array $options = []): ResponseInterface
    method delete (line 127) | public function delete($uri, array $options = []): ResponseInterface
    method requestAsync (line 144) | abstract public function requestAsync(string $method, $uri, array $opt...
    method getAsync (line 157) | public function getAsync($uri, array $options = []): PromiseInterface
    method headAsync (line 173) | public function headAsync($uri, array $options = []): PromiseInterface
    method putAsync (line 189) | public function putAsync($uri, array $options = []): PromiseInterface
    method postAsync (line 205) | public function postAsync($uri, array $options = []): PromiseInterface
    method patchAsync (line 221) | public function patchAsync($uri, array $options = []): PromiseInterface
    method deleteAsync (line 237) | public function deleteAsync($uri, array $options = []): PromiseInterface

FILE: src/Cookie/CookieJar.php
  class CookieJar (line 11) | class CookieJar implements CookieJarInterface
    method __construct (line 30) | public function __construct(bool $strictMode = false, array $cookieArr...
    method fromArray (line 48) | public static function fromArray(array $cookies, string $domain): self
    method shouldPersist (line 70) | public static function shouldPersist(SetCookie $cookie, bool $allowSes...
    method getCookieByName (line 88) | public function getCookieByName(string $name): ?SetCookie
    method toArray (line 99) | public function toArray(): array
    method clear (line 106) | public function clear(?string $domain = null, ?string $path = null, ?s...
    method clearSessionCookies (line 139) | public function clearSessionCookies(): void
    method setCookie (line 149) | public function setCookie(SetCookie $cookie): bool
    method count (line 209) | public function count(): int
    method getIterator (line 217) | public function getIterator(): \ArrayIterator
    method extractCookies (line 222) | public function extractCookies(RequestInterface $request, ResponseInte...
    method getCookiePathFromRequest (line 248) | private function getCookiePathFromRequest(RequestInterface $request): ...
    method withCookieHeader (line 268) | public function withCookieHeader(RequestInterface $request): RequestIn...
    method removeCookieIfEmpty (line 296) | private function removeCookieIfEmpty(SetCookie $cookie): void

FILE: src/Cookie/CookieJarInterface.php
  type CookieJarInterface (line 20) | interface CookieJarInterface extends \Countable, \IteratorAggregate
    method withCookieHeader (line 32) | public function withCookieHeader(RequestInterface $request): RequestIn...
    method extractCookies (line 40) | public function extractCookies(RequestInterface $request, ResponseInte...
    method setCookie (line 49) | public function setCookie(SetCookie $cookie): bool;
    method clear (line 65) | public function clear(?string $domain = null, ?string $path = null, ?s...
    method clearSessionCookies (line 74) | public function clearSessionCookies(): void;
    method toArray (line 79) | public function toArray(): array;

FILE: src/Cookie/FileCookieJar.php
  class FileCookieJar (line 10) | class FileCookieJar extends CookieJar
    method __construct (line 31) | public function __construct(string $cookieFile, bool $storeSessionCook...
    method __destruct (line 45) | public function __destruct()
    method save (line 57) | public function save(string $filename): void
    method load (line 82) | public function load(string $filename): void

FILE: src/Cookie/SessionCookieJar.php
  class SessionCookieJar (line 8) | class SessionCookieJar extends CookieJar
    method __construct (line 28) | public function __construct(string $sessionKey, bool $storeSessionCook...
    method __destruct (line 39) | public function __destruct()
    method save (line 47) | public function save(): void
    method load (line 63) | protected function load(): void

FILE: src/Cookie/SetCookie.php
  class SetCookie (line 8) | class SetCookie
    method fromString (line 35) | public static function fromString(string $cookie): self
    method __construct (line 85) | public function __construct(array $data = [])
    method __toString (line 139) | public function __toString()
    method toArray (line 155) | public function toArray(): array
    method getName (line 165) | public function getName()
    method setName (line 175) | public function setName($name): void
    method getValue (line 189) | public function getValue()
    method setValue (line 199) | public function setValue($value): void
    method getDomain (line 213) | public function getDomain()
    method setDomain (line 223) | public function setDomain($domain): void
    method getPath (line 237) | public function getPath()
    method setPath (line 247) | public function setPath($path): void
    method getMaxAge (line 261) | public function getMaxAge()
    method setMaxAge (line 271) | public function setMaxAge($maxAge): void
    method getExpires (line 285) | public function getExpires()
    method setExpires (line 295) | public function setExpires($timestamp): void
    method getSecure (line 309) | public function getSecure()
    method setSecure (line 319) | public function setSecure($secure): void
    method getDiscard (line 333) | public function getDiscard()
    method setDiscard (line 343) | public function setDiscard($discard): void
    method getHttpOnly (line 357) | public function getHttpOnly()
    method setHttpOnly (line 367) | public function setHttpOnly($httpOnly): void
    method matchesPath (line 391) | public function matchesPath(string $requestPath): bool
    method matchesDomain (line 419) | public function matchesDomain(string $domain): bool
    method isExpired (line 449) | public function isExpired(): bool
    method validate (line 459) | public function validate()

FILE: src/Exception/BadResponseException.php
  class BadResponseException (line 11) | class BadResponseException extends RequestException
    method __construct (line 13) | public function __construct(
    method hasResponse (line 26) | public function hasResponse(): bool
    method getResponse (line 34) | public function getResponse(): ResponseInterface

FILE: src/Exception/ClientException.php
  class ClientException (line 8) | class ClientException extends BadResponseException

FILE: src/Exception/ConnectException.php
  class ConnectException (line 13) | class ConnectException extends TransferException implements NetworkExcep...
    method __construct (line 25) | public function __construct(
    method getRequest (line 39) | public function getRequest(): RequestInterface
    method getHandlerContext (line 52) | public function getHandlerContext(): array

FILE: src/Exception/GuzzleException.php
  type GuzzleException (line 7) | interface GuzzleException extends ClientExceptionInterface

FILE: src/Exception/InvalidArgumentException.php
  class InvalidArgumentException (line 5) | final class InvalidArgumentException extends \InvalidArgumentException i...

FILE: src/Exception/RequestException.php
  class RequestException (line 14) | class RequestException extends TransferException implements RequestExcep...
    method __construct (line 31) | public function __construct(
    method wrapException (line 49) | public static function wrapException(RequestInterface $request, \Throw...
    method create (line 63) | public static function create(
    method getRequest (line 117) | public function getRequest(): RequestInterface
    method getResponse (line 125) | public function getResponse(): ?ResponseInterface
    method hasResponse (line 133) | public function hasResponse(): bool
    method getHandlerContext (line 146) | public function getHandlerContext(): array

FILE: src/Exception/ServerException.php
  class ServerException (line 8) | class ServerException extends BadResponseException

FILE: src/Exception/TooManyRedirectsException.php
  class TooManyRedirectsException (line 5) | class TooManyRedirectsException extends RequestException

FILE: src/Exception/TransferException.php
  class TransferException (line 5) | class TransferException extends \RuntimeException implements GuzzleExcep...

FILE: src/Handler/CurlFactory.php
  class CurlFactory (line 21) | class CurlFactory implements CurlFactoryInterface
    method __construct (line 43) | public function __construct(int $maxHandles)
    method create (line 48) | public function create(RequestInterface $request, array $options): Eas...
    method supportsHttp2 (line 86) | private static function supportsHttp2(): bool
    method supportsTls12 (line 99) | private static function supportsTls12(): bool
    method supportsTls13 (line 110) | private static function supportsTls13(): bool
    method release (line 122) | public function release(EasyHandle $easy): void
    method finish (line 152) | public static function finish(callable $handler, EasyHandle $easy, Cur...
    method invokeStats (line 174) | private static function invokeStats(EasyHandle $easy): void
    method finishError (line 191) | private static function finishError(callable $handler, EasyHandle $eas...
    method getCurlVersion (line 210) | private static function getCurlVersion(): string
    method createRejection (line 221) | private static function createRejection(EasyHandle $easy, array $ctx):...
    method sanitizeCurlError (line 283) | private static function sanitizeCurlError(string $error, UriInterface ...
    method getDefaultConf (line 304) | private function getDefaultConf(EasyHandle $easy): array
    method applyMethod (line 332) | private function applyMethod(EasyHandle $easy, array &$conf): void
    method applyBody (line 360) | private function applyBody(RequestInterface $request, array $options, ...
    method applyHeaders (line 399) | private function applyHeaders(EasyHandle $easy, array &$conf): void
    method removeHeader (line 426) | private function removeHeader(string $name, array &$options): void
    method applyHandlerOptions (line 437) | private function applyHandlerOptions(EasyHandle $easy, array &$conf): ...
    method retryFailedRewind (line 646) | private static function retryFailedRewind(callable $handler, EasyHandl...
    method createHeaderFn (line 682) | private function createHeaderFn(EasyHandle $easy): callable
    method __destruct (line 731) | public function __destruct()

FILE: src/Handler/CurlFactoryInterface.php
  type CurlFactoryInterface (line 7) | interface CurlFactoryInterface
    method create (line 17) | public function create(RequestInterface $request, array $options): Eas...
    method release (line 24) | public function release(EasyHandle $easy): void;

FILE: src/Handler/CurlHandler.php
  class CurlHandler (line 17) | class CurlHandler
    method __construct (line 31) | public function __construct(array $options = [])
    method __invoke (line 37) | public function __invoke(RequestInterface $request, array $options): P...

FILE: src/Handler/CurlMultiHandler.php
  class CurlMultiHandler (line 21) | class CurlMultiHandler
    method __construct (line 69) | public function __construct(array $options = [])
    method __get (line 97) | public function __get($name)
    method __destruct (line 119) | public function __destruct()
    method __invoke (line 127) | public function __invoke(RequestInterface $request, array $options): P...
    method tick (line 147) | public function tick(): void
    method tickInQueue (line 186) | private function tickInQueue(): void
    method execute (line 197) | public function execute(): void
    method addRequest (line 210) | private function addRequest(array $entry): void
    method cancel (line 229) | private function cancel($id): bool
    method processMessages (line 251) | private function processMessages(): void
    method timeToNext (line 275) | private function timeToNext(): int

FILE: src/Handler/EasyHandle.php
  class EasyHandle (line 16) | final class EasyHandle
    method createResponse (line 69) | public function createResponse(): void
    method __get (line 107) | public function __get($name)

FILE: src/Handler/HeaderProcessor.php
  class HeaderProcessor (line 10) | final class HeaderProcessor
    method parseHeaders (line 21) | public static function parseHeaders(array $headers): array

FILE: src/Handler/MockHandler.php
  class MockHandler (line 20) | class MockHandler implements \Countable
    method createWithMiddleware (line 55) | public static function createWithMiddleware(?array $queue = null, ?cal...
    method __construct (line 69) | public function __construct(?array $queue = null, ?callable $onFulfill...
    method __invoke (line 80) | public function __invoke(RequestInterface $request, array $options): P...
    method append (line 153) | public function append(...$values): void
    method getLastRequest (line 171) | public function getLastRequest(): ?RequestInterface
    method getLastOptions (line 179) | public function getLastOptions(): array
    method count (line 187) | public function count(): int
    method reset (line 192) | public function reset(): void
    method invokeStats (line 200) | private function invokeStats(

FILE: src/Handler/Proxy.php
  class Proxy (line 14) | class Proxy
    method wrapSync (line 25) | public static function wrapSync(callable $default, callable $sync): ca...
    method wrapStreaming (line 45) | public static function wrapStreaming(callable $default, callable $stre...

FILE: src/Handler/StreamHandler.php
  class StreamHandler (line 23) | class StreamHandler
    method __invoke (line 36) | public function __invoke(RequestInterface $request, array $options): P...
    method invokeStats (line 94) | private function invokeStats(
    method createResponse (line 110) | private function createResponse(RequestInterface $request, array $opti...
    method createSink (line 160) | private function createSink(StreamInterface $stream, array $options): ...
    method checkDecode (line 174) | private function checkDecode(array $options, array $headers, $stream):...
    method drain (line 213) | private function drain(StreamInterface $source, StreamInterface $sink,...
    method createResource (line 240) | private function createResource(callable $callback)
    method createStream (line 275) | private function createStream(RequestInterface $request, array $options)
    method resolveHost (line 363) | private function resolveHost(RequestInterface $request, array $options...
    method getDefaultContext (line 389) | private function getDefaultContext(RequestInterface $request): array
    method add_proxy (line 429) | private function add_proxy(RequestInterface $request, array &$options,...
    method parse_proxy (line 462) | private function parse_proxy(string $url): array
    method add_timeout (line 490) | private function add_timeout(RequestInterface $request, array &$option...
    method add_crypto_method (line 500) | private function add_crypto_method(RequestInterface $request, array &$...
    method add_verify (line 519) | private function add_verify(RequestInterface $request, array &$options...
    method add_cert (line 545) | private function add_cert(RequestInterface $request, array &$options, ...
    method add_progress (line 562) | private function add_progress(RequestInterface $request, array &$optio...
    method add_debug (line 579) | private function add_debug(RequestInterface $request, array &$options,...
    method addNotification (line 613) | private static function addNotification(array &$params, callable $noti...
    method callArray (line 626) | private static function callArray(array $functions): callable

FILE: src/HandlerStack.php
  class HandlerStack (line 15) | class HandlerStack
    method create (line 47) | public static function create(?callable $handler = null): self
    method __construct (line 61) | public function __construct(?callable $handler = null)
    method __invoke (line 71) | public function __invoke(RequestInterface $request, array $options)
    method __toString (line 83) | public function __toString()
    method setHandler (line 114) | public function setHandler(callable $handler): void
    method hasHandler (line 123) | public function hasHandler(): bool
    method unshift (line 134) | public function unshift(callable $middleware, ?string $name = null): void
    method push (line 146) | public function push(callable $middleware, string $name = ''): void
    method before (line 159) | public function before(string $findName, callable $middleware, string ...
    method after (line 171) | public function after(string $findName, callable $middleware, string $...
    method remove (line 181) | public function remove($remove): void
    method resolve (line 202) | public function resolve(): callable
    method findByName (line 220) | private function findByName(string $name): int
    method splice (line 234) | private function splice(string $findName, string $withName, callable $...
    method debugCallable (line 260) | private function debugCallable($fn): string

FILE: src/MessageFormatter.php
  class MessageFormatter (line 38) | class MessageFormatter implements MessageFormatterInterface
    method __construct (line 59) | public function __construct(?string $template = self::CLF)
    method format (line 71) | public function format(RequestInterface $request, ?ResponseInterface $...
    method headers (line 190) | private function headers(MessageInterface $message): string

FILE: src/MessageFormatterInterface.php
  type MessageFormatterInterface (line 8) | interface MessageFormatterInterface
    method format (line 17) | public function format(RequestInterface $request, ?ResponseInterface $...

FILE: src/Middleware.php
  class Middleware (line 16) | final class Middleware
    method cookies (line 26) | public static function cookies(): callable
    method httpErrors (line 58) | public static function httpErrors(?BodySummarizerInterface $bodySummar...
    method history (line 88) | public static function history(&$container): callable
    method tap (line 135) | public static function tap(?callable $before = null, ?callable $after ...
    method redirect (line 157) | public static function redirect(): callable
    method retry (line 179) | public static function retry(callable $decider, ?callable $delay = nul...
    method log (line 198) | public static function log(LoggerInterface $logger, $formatter, string...
    method prepareBody (line 230) | public static function prepareBody(): callable
    method mapRequest (line 244) | public static function mapRequest(callable $fn): callable
    method mapResponse (line 260) | public static function mapResponse(callable $fn): callable

FILE: src/Pool.php
  class Pool (line 24) | class Pool implements PromisorInterface
    method __construct (line 41) | public function __construct(ClientInterface $client, $requests, array ...
    method promise (line 73) | public function promise(): PromiseInterface
    method batch (line 96) | public static function batch(ClientInterface $client, $requests, array...
    method cmpCallback (line 111) | private static function cmpCallback(array &$options, string $name, arr...

FILE: src/PrepareBodyMiddleware.php
  class PrepareBodyMiddleware (line 14) | class PrepareBodyMiddleware
    method __construct (line 24) | public function __construct(callable $nextHandler)
    method __invoke (line 29) | public function __invoke(RequestInterface $request, array $options): P...
    method addExpectHeader (line 70) | private function addExpectHeader(RequestInterface $request, array $opt...

FILE: src/RedirectMiddleware.php
  class RedirectMiddleware (line 20) | class RedirectMiddleware
    method __construct (line 45) | public function __construct(callable $nextHandler)
    method __invoke (line 50) | public function __invoke(RequestInterface $request, array $options): P...
    method checkRedirect (line 80) | public function checkRedirect(RequestInterface $request, array $option...
    method withTracking (line 124) | private function withTracking(PromiseInterface $promise, string $uri, ...
    method guardMax (line 147) | private function guardMax(RequestInterface $request, ResponseInterface...
    method modifyRequest (line 159) | public function modifyRequest(RequestInterface $request, array $option...
    method redirectUri (line 211) | private static function redirectUri(

FILE: src/RequestOptions.php
  class RequestOptions (line 10) | final class RequestOptions

FILE: src/RetryMiddleware.php
  class RetryMiddleware (line 16) | class RetryMiddleware
    method __construct (line 43) | public function __construct(callable $decider, callable $nextHandler, ...
    method exponentialDelay (line 55) | public static function exponentialDelay(int $retries): int
    method __invoke (line 60) | public function __invoke(RequestInterface $request, array $options): P...
    method onFulfilled (line 78) | private function onFulfilled(RequestInterface $request, array $options...
    method onRejected (line 97) | private function onRejected(RequestInterface $req, array $options): ca...
    method doRetry (line 113) | private function doRetry(RequestInterface $request, array $options, ?R...

FILE: src/TransferStats.php
  class TransferStats (line 13) | final class TransferStats
    method __construct (line 47) | public function __construct(
    method getRequest (line 61) | public function getRequest(): RequestInterface
    method getResponse (line 69) | public function getResponse(): ?ResponseInterface
    method hasResponse (line 77) | public function hasResponse(): bool
    method getHandlerErrorData (line 91) | public function getHandlerErrorData()
    method getEffectiveUri (line 99) | public function getEffectiveUri(): UriInterface
    method getTransferTime (line 109) | public function getTransferTime(): ?float
    method getHandlerStats (line 117) | public function getHandlerStats(): array
    method getHandlerStat (line 129) | public function getHandlerStat(string $stat)

FILE: src/Utils.php
  class Utils (line 12) | final class Utils
    method describeType (line 22) | public static function describeType($input): string
    method headersFromLines (line 46) | public static function headersFromLines(iterable $lines): array
    method debugResource (line 65) | public static function debugResource($value = null)
    method chooseHandler (line 86) | public static function chooseHandler(): callable
    method defaultUserAgent (line 114) | public static function defaultUserAgent(): string
    method defaultCaBundle (line 134) | public static function defaultCaBundle(): string
    method normalizeHeaderKeys (line 194) | public static function normalizeHeaderKeys(array $headers): array
    method isHostInNoProxy (line 223) | public static function isHostInNoProxy(string $host, array $noProxyArr...
    method jsonDecode (line 273) | public static function jsonDecode(string $json, bool $assoc = false, i...
    method jsonEncode (line 294) | public static function jsonEncode($value, int $options = 0, int $depth...
    method currentTime (line 313) | public static function currentTime(): float
    method idnUriConvert (line 323) | public static function idnUriConvert(UriInterface $uri, int $options =...
    method getenv (line 360) | public static function getenv(string $name): ?string
    method idnToAsci (line 376) | private static function idnToAsci(string $domain, int $options, ?array...

FILE: src/functions.php
  function describe_type (line 16) | function describe_type($input): string
  function headers_from_lines (line 29) | function headers_from_lines(iterable $lines): array
  function debug_resource (line 43) | function debug_resource($value = null)
  function choose_handler (line 59) | function choose_handler(): callable
  function default_user_agent (line 69) | function default_user_agent(): string
  function default_ca_bundle (line 89) | function default_ca_bundle(): string
  function normalize_header_keys (line 100) | function normalize_header_keys(array $headers): array
  function is_host_in_noproxy (line 126) | function is_host_in_noproxy(string $host, array $noProxyArray): bool
  function json_decode (line 147) | function json_decode(string $json, bool $assoc = false, int $depth = 512...
  function json_encode (line 164) | function json_encode($value, int $options = 0, int $depth = 512): string

FILE: tests/ClientTest.php
  class ClientTest (line 19) | class ClientTest extends TestCase
    method testUsesDefaultHandler (line 21) | public function testUsesDefaultHandler()
    method testValidatesArgsForMagicMethods (line 29) | public function testValidatesArgsForMagicMethods()
    method testCanSendAsyncGetRequests (line 38) | public function testCanSendAsyncGetRequests()
    method testCanSendSynchronously (line 51) | public function testCanSendSynchronously()
    method testClientHasOptions (line 60) | public function testClientHasOptions()
    method testCanMergeOnBaseUri (line 78) | public function testCanMergeOnBaseUri()
    method testCanMergeOnBaseUriWithRequest (line 92) | public function testCanMergeOnBaseUriWithRequest()
    method testCanUseRelativeUriWithSend (line 113) | public function testCanUseRelativeUriWithSend()
    method testMergesDefaultOptionsAndDoesNotOverwriteUa (line 130) | public function testMergesDefaultOptionsAndDoesNotOverwriteUa()
    method testDoesNotOverwriteHeaderWithDefault (line 141) | public function testDoesNotOverwriteHeaderWithDefault()
    method testDoesNotOverwriteHeaderWithDefaultInRequest (line 152) | public function testDoesNotOverwriteHeaderWithDefaultInRequest()
    method testDoesOverwriteHeaderWithSetRequestOption (line 164) | public function testDoesOverwriteHeaderWithSetRequestOption()
    method testCanUnsetRequestOptionWithNull (line 176) | public function testCanUnsetRequestOptionWithNull()
    method testAllowRedirectsCanBeTrue (line 187) | public function testAllowRedirectsCanBeTrue()
    method testValidatesAllowRedirects (line 196) | public function testValidatesAllowRedirects()
    method testThrowsHttpErrorsByDefault (line 207) | public function testThrowsHttpErrorsByDefault()
    method testValidatesCookies (line 217) | public function testValidatesCookies()
    method testSetCookieToTrueUsesSharedJar (line 228) | public function testSetCookieToTrueUsesSharedJar()
    method testSetCookieToJar (line 241) | public function testSetCookieToJar()
    method testCanDisableContentDecoding (line 255) | public function testCanDisableContentDecoding()
    method testCanSetContentDecodingToValue (line 265) | public function testCanSetContentDecodingToValue()
    method testAddsAcceptEncodingbyCurl (line 275) | public function testAddsAcceptEncodingbyCurl()
    method testValidatesHeaders (line 290) | public function testValidatesHeaders()
    method testAddsBody (line 299) | public function testAddsBody()
    method testValidatesQuery (line 309) | public function testValidatesQuery()
    method testQueryCanBeString (line 319) | public function testQueryCanBeString()
    method testQueryCanBeArray (line 328) | public function testQueryCanBeArray()
    method testCanAddJsonData (line 337) | public function testCanAddJsonData()
    method testCanAddJsonDataWithoutOverwritingContentType (line 348) | public function testCanAddJsonDataWithoutOverwritingContentType()
    method testCanAddJsonDataWithNullHeader (line 362) | public function testCanAddJsonDataWithNullHeader()
    method testAuthCanBeTrue (line 376) | public function testAuthCanBeTrue()
    method testAuthCanBeArrayForBasicAuth (line 385) | public function testAuthCanBeArrayForBasicAuth()
    method testAuthCanBeArrayForDigestAuth (line 394) | public function testAuthCanBeArrayForDigestAuth()
    method testAuthCanBeArrayForNtlmAuth (line 406) | public function testAuthCanBeArrayForNtlmAuth()
    method testAuthCanBeCustomType (line 418) | public function testAuthCanBeCustomType()
    method testCanAddFormParams (line 427) | public function testCanAddFormParams()
    method testFormParamsEncodedProperly (line 448) | public function testFormParamsEncodedProperly()
    method testEnsuresThatFormParamsAndMultipartAreExclusive (line 469) | public function testEnsuresThatFormParamsAndMultipartAreExclusive()
    method testCanSendMultipart (line 481) | public function testCanSendMultipart()
    method testCanSendMultipartWithExplicitBody (line 520) | public function testCanSendMultipartWithExplicitBody()
    method testUsesProxyEnvironmentVariables (line 566) | public function testUsesProxyEnvironmentVariables()
    method testRequestSendsWithSync (line 600) | public function testRequestSendsWithSync()
    method testSendSendsWithSync (line 608) | public function testSendSendsWithSync()
    method testSendWithInvalidHeader (line 616) | public function testSendWithInvalidHeader()
    method testSendWithInvalidHeaders (line 626) | public function testSendWithInvalidHeaders()
    method testCanSetCustomHandler (line 636) | public function testCanSetCustomHandler()
    method testProperlyBuildsQuery (line 649) | public function testProperlyBuildsQuery()
    method testSendSendsWithIpAddressAndPortAndHostHeaderInRequestTheHostShouldBePreserved (line 658) | public function testSendSendsWithIpAddressAndPortAndHostHeaderInReques...
    method testSendSendsWithDomainAndHostHeaderInRequestTheHostShouldBePreserved (line 669) | public function testSendSendsWithDomainAndHostHeaderInRequestTheHostSh...
    method testValidatesSink (line 680) | public function testValidatesSink()
    method testHttpDefaultSchemeIfUriHasNone (line 689) | public function testHttpDefaultSchemeIfUriHasNone()
    method testOnlyAddSchemeWhenHostIsPresent (line 699) | public function testOnlyAddSchemeWhenHostIsPresent()
    method testThatVersionIsOverwrittenWhenSendingARequest (line 711) | public function testThatVersionIsOverwrittenWhenSendingARequest()
    method testHandlerIsCallable (line 731) | public function testHandlerIsCallable()
    method testResponseBodyAsString (line 738) | public function testResponseBodyAsString()
    method testResponseContent (line 749) | public function testResponseContent()
    method testIdnSupportDefaultValue (line 760) | public function testIdnSupportDefaultValue()
    method testIdnIsTranslatedToAsciiWhenConversionIsEnabled (line 773) | public function testIdnIsTranslatedToAsciiWhenConversionIsEnabled()
    method testIdnStaysTheSameWhenConversionIsDisabled (line 786) | public function testIdnStaysTheSameWhenConversionIsDisabled()
    method testExceptionOnInvalidIdn (line 802) | public function testExceptionOnInvalidIdn()
    method testIdnBaseUri (line 817) | public function testIdnBaseUri()
    method testIdnWithRedirect (line 836) | public function testIdnWithRedirect()

FILE: tests/Cookie/CookieJarTest.php
  class CookieJarTest (line 17) | class CookieJarTest extends TestCase
    method setUp (line 24) | public function setUp(): void
    method getTestCookies (line 29) | protected function getTestCookies()
    method testCreatesFromArray (line 38) | public function testCreatesFromArray()
    method testEmptyJarIsCountable (line 47) | public function testEmptyJarIsCountable()
    method testGetsCookiesByName (line 52) | public function testGetsCookiesByName()
    method getCookiesDataProvider (line 68) | public static function getCookiesDataProvider()
    method testStoresAndRetrievesCookies (line 84) | public function testStoresAndRetrievesCookies()
    method testRemovesTemporaryCookies (line 96) | public function testRemovesTemporaryCookies()
    method testRemovesSelectively (line 109) | public function testRemovesSelectively()
    method providesIncompleteCookies (line 131) | public static function providesIncompleteCookies(): array
    method testDoesNotAddIncompleteCookies (line 164) | public function testDoesNotAddIncompleteCookies(array $cookie)
    method providesEmptyCookies (line 169) | public static function providesEmptyCookies(): array
    method testDoesNotAddEmptyCookies (line 192) | public function testDoesNotAddEmptyCookies(array $cookie)
    method providesValidCookies (line 197) | public static function providesValidCookies(): array
    method testDoesAddValidCookies (line 234) | public function testDoesAddValidCookies(array $cookie)
    method testOverwritesCookiesThatAreOlderOrDiscardable (line 239) | public function testOverwritesCookiesThatAreOlderOrDiscardable()
    method testOverwritesCookiesThatHaveChanged (line 276) | public function testOverwritesCookiesThatHaveChanged()
    method testAddsCookiesFromResponseWithRequest (line 307) | public function testAddsCookiesFromResponseWithRequest()
    method getMatchingCookiesDataProvider (line 317) | public static function getMatchingCookiesDataProvider()
    method testReturnsCookiesMatchingRequests (line 331) | public function testReturnsCookiesMatchingRequests(string $url, string...
    method testThrowsExceptionWithStrictMode (line 382) | public function testThrowsExceptionWithStrictMode()
    method testDeletesCookiesByName (line 390) | public function testDeletesCookiesByName()
    method testCanConvertToAndLoadFromArray (line 413) | public function testCanConvertToAndLoadFromArray()
    method testAddsCookiesWithEmptyPathFromResponse (line 427) | public function testAddsCookiesWithEmptyPathFromResponse()
    method getCookiePathsDataProvider (line 438) | public static function getCookiePathsDataProvider()
    method testCookiePathWithEmptySetCookiePath (line 452) | public function testCookiePathWithEmptySetCookiePath(string $uriPath, ...
    method getDomainMatchesProvider (line 471) | public static function getDomainMatchesProvider()
    method testIgnoresCookiesForMismatchingDomains (line 489) | public function testIgnoresCookiesForMismatchingDomains(string $reques...
    method futureExpirationDate (line 503) | private function futureExpirationDate()

FILE: tests/Cookie/FileCookieJarTest.php
  class FileCookieJarTest (line 12) | class FileCookieJarTest extends TestCase
    method setUp (line 16) | public function setUp(): void
    method testValidatesCookieFile (line 24) | public function testValidatesCookieFile($invalidCookieJarContent)
    method testLoadsFromFile (line 32) | public function testLoadsFromFile()
    method testPersistsToFile (line 42) | public function testPersistsToFile($testSaveSessionCookie = false)
    method testRemovesCookie (line 84) | public function testRemovesCookie()
    method testUpdatesCookie (line 105) | public function testUpdatesCookie()
    method providerPersistsToFileFileParameters (line 133) | public static function providerPersistsToFileFileParameters()
    method invalidCookieJarContent (line 141) | public static function invalidCookieJarContent(): array

FILE: tests/Cookie/SessionCookieJarTest.php
  class SessionCookieJarTest (line 12) | class SessionCookieJarTest extends TestCase
    method setUp (line 16) | public function setUp(): void
    method testValidatesCookieSession (line 25) | public function testValidatesCookieSession()
    method testLoadsFromSession (line 33) | public function testLoadsFromSession()
    method testPersistsToSession (line 43) | public function testPersistsToSession($testSaveSessionCookie = false)
    method providerPersistsToSessionParameters (line 85) | public static function providerPersistsToSessionParameters()

FILE: tests/Cookie/SetCookieTest.php
  class SetCookieTest (line 11) | class SetCookieTest extends TestCase
    method testInitializesDefaultValues (line 13) | public function testInitializesDefaultValues()
    method testConvertsDateTimeMaxAgeToUnixTimestamp (line 19) | public function testConvertsDateTimeMaxAgeToUnixTimestamp()
    method testAddsExpiresBasedOnMaxAge (line 25) | public function testAddsExpiresBasedOnMaxAge()
    method testHoldsValues (line 32) | public function testHoldsValues()
    method testDeterminesIfExpired (line 85) | public function testDeterminesIfExpired()
    method testMatchesDomain (line 94) | public function testMatchesDomain()
    method pathMatchProvider (line 125) | public static function pathMatchProvider()
    method testMatchesPath (line 149) | public function testMatchesPath($cookiePath, $requestPath, $isMatch)
    method cookieValidateProvider (line 156) | public static function cookieValidateProvider()
    method testValidatesCookies (line 173) | public function testValidatesCookies($name, $value, $domain, $result)
    method testDoesNotMatchIp (line 183) | public function testDoesNotMatchIp()
    method testConvertsToString (line 189) | public function testConvertsToString()
    method cookieParserDataProvider (line 212) | public static function cookieParserDataProvider()
    method testParseCookie (line 414) | public function testParseCookie($cookie, $parsed)
    method isExpiredProvider (line 456) | public static function isExpiredProvider()
    method testIsExpired (line 485) | public function testIsExpired($cookie, $expired)

FILE: tests/Exception/BadResponseExceptionTest.php
  class BadResponseExceptionTest (line 10) | class BadResponseExceptionTest extends TestCase
    method testHasNoResponse (line 12) | public function testHasNoResponse()

FILE: tests/Exception/ConnectExceptionTest.php
  class ConnectExceptionTest (line 14) | class ConnectExceptionTest extends TestCase
    method testHasRequest (line 16) | public function testHasRequest()

FILE: tests/Exception/RequestExceptionTest.php
  class RequestExceptionTest (line 18) | class RequestExceptionTest extends TestCase
    method testHasRequestAndResponse (line 20) | public function testHasRequestAndResponse()
    method testCreatesGenerateException (line 33) | public function testCreatesGenerateException()
    method testCreatesClientErrorResponseException (line 40) | public function testCreatesClientErrorResponseException()
    method testCreatesServerErrorResponseException (line 54) | public function testCreatesServerErrorResponseException()
    method testCreatesGenericErrorResponseException (line 68) | public function testCreatesGenericErrorResponseException()
    method testThrowsInvalidArgumentExceptionOnOutOfBoundsResponseCode (line 82) | public function testThrowsInvalidArgumentExceptionOnOutOfBoundsRespons...
    method dataPrintableResponses (line 90) | public static function dataPrintableResponses()
    method testCreatesExceptionWithPrintableBodySummary (line 105) | public function testCreatesExceptionWithPrintableBodySummary($content)
    method testCreatesExceptionWithTruncatedSummary (line 120) | public function testCreatesExceptionWithTruncatedSummary()
    method testExceptionMessageIgnoresEmptyBody (line 129) | public function testExceptionMessageIgnoresEmptyBody()
    method testHasStatusCodeAsExceptionCode (line 135) | public function testHasStatusCodeAsExceptionCode()
    method testWrapsRequestExceptions (line 141) | public function testWrapsRequestExceptions()
    method testDoesNotWrapExistingRequestExceptions (line 150) | public function testDoesNotWrapExistingRequestExceptions()
    method testCanProvideHandlerContext (line 158) | public function testCanProvideHandlerContext()
    method testObfuscateUrlWithUsername (line 165) | public function testObfuscateUrlWithUsername()
    method testObfuscateUrlWithUsernameAndPassword (line 172) | public function testObfuscateUrlWithUsernameAndPassword()
  class ReadSeekOnlyStream (line 180) | final class ReadSeekOnlyStream extends Stream
    method __construct (line 182) | public function __construct()
    method isSeekable (line 187) | public function isSeekable(): bool
    method isReadable (line 192) | public function isReadable(): bool

FILE: tests/Handler/CurlFactoryTest.php
  class CurlFactoryTest (line 21) | class CurlFactoryTest extends TestCase
    method setUpBeforeClass (line 23) | public static function setUpBeforeClass(): void
    method tearDownAfterClass (line 29) | public static function tearDownAfterClass(): void
    method testCreatesCurlHandle (line 34) | public function testCreatesCurlHandle()
    method testSendsHeadRequests (line 94) | public function testSendsHeadRequests()
    method testCanAddCustomCurlOptions (line 109) | public function testCanAddCustomCurlOptions()
    method testCanChangeCurlOptions (line 119) | public function testCanChangeCurlOptions()
    method testValidatesVerify (line 129) | public function testValidatesVerify()
    method testCanSetVerifyToFile (line 138) | public function testCanSetVerifyToFile()
    method testCanSetVerifyToDir (line 147) | public function testCanSetVerifyToDir()
    method testAddsVerifyAsTrue (line 156) | public function testAddsVerifyAsTrue()
    method testCanDisableVerify (line 165) | public function testCanDisableVerify()
    method testAddsProxy (line 173) | public function testAddsProxy()
    method testAddsViaScheme (line 180) | public function testAddsViaScheme()
    method checkNoProxyForHost (line 194) | private function checkNoProxyForHost($url, $noProxy, $assertUseProxy)
    method testUsesProxy (line 211) | public function testUsesProxy()
    method testValidatesCryptoMethodInvalidMethod (line 234) | public function testValidatesCryptoMethodInvalidMethod()
    method testAddsCryptoMethodTls10 (line 243) | public function testAddsCryptoMethodTls10()
    method testAddsCryptoMethodTls11 (line 250) | public function testAddsCryptoMethodTls11()
    method testAddsCryptoMethodTls12 (line 257) | public function testAddsCryptoMethodTls12()
    method testAddsCryptoMethodTls13 (line 267) | public function testAddsCryptoMethodTls13()
    method testValidatesSslKey (line 274) | public function testValidatesSslKey()
    method testAddsSslKey (line 283) | public function testAddsSslKey()
    method testAddsSslKeyWithPassword (line 290) | public function testAddsSslKeyWithPassword()
    method testAddsSslKeyWhenUsingArraySyntaxButNoPassword (line 298) | public function testAddsSslKeyWhenUsingArraySyntaxButNoPassword()
    method testValidatesCert (line 306) | public function testValidatesCert()
    method testAddsCert (line 315) | public function testAddsCert()
    method testAddsCertWithPassword (line 322) | public function testAddsCertWithPassword()
    method testAddsDerCert (line 330) | public function testAddsDerCert()
    method testAddsP12Cert (line 344) | public function testAddsP12Cert()
    method testValidatesProgress (line 358) | public function testValidatesProgress()
    method testEmitsDebugInfoToStream (line 367) | public function testEmitsDebugInfoToStream()
    method testEmitsProgressToFunction (line 382) | public function testEmitsProgressToFunction()
    method addDecodeResponse (line 401) | private function addDecodeResponse($withEncoding = true)
    method testDecodesGzippedResponses (line 415) | public function testDecodesGzippedResponses()
    method testReportsOriginalSizeAndContentEncodingAfterDecoding (line 428) | public function testReportsOriginalSizeAndContentEncodingAfterDecoding()
    method testDecodesGzippedResponsesWithHeader (line 445) | public function testDecodesGzippedResponsesWithHeader()
    method testDecodesGzippedResponsesWithHeaderForHeadRequest (line 466) | public function testDecodesGzippedResponsesWithHeaderForHeadRequest()
    method testDoesNotForceDecode (line 484) | public function testDoesNotForceDecode()
    method testProtocolVersion (line 496) | public function testProtocolVersion()
    method testSavesToStream (line 506) | public function testSavesToStream()
    method testSavesToGuzzleStream (line 521) | public function testSavesToGuzzleStream()
    method testSavesToFileOnDisk (line 535) | public function testSavesToFileOnDisk()
    method testDoesNotAddMultipleContentLengthHeaders (line 550) | public function testDoesNotAddMultipleContentLengthHeaders()
    method testSendsPostWithNoBodyOrDefaultContentType (line 563) | public function testSendsPostWithNoBodyOrDefaultContentType()
    method testFailsWhenCannotRewindRetryAfterNoResponse (line 577) | public function testFailsWhenCannotRewindRetryAfterNoResponse()
    method testRetriesWhenBodyCanBeRewound (line 595) | public function testRetriesWhenBodyCanBeRewound()
    method testFailsWhenRetryMoreThanThreeTimes (line 624) | public function testFailsWhenRetryMoreThanThreeTimes()
    method testHandles100Continue (line 644) | public function testHandles100Continue()
    method testCreatesConnectException (line 662) | public function testCreatesConnectException()
    method testAddsTimeouts (line 685) | public function testAddsTimeouts()
    method testAddsStreamingBody (line 696) | public function testAddsStreamingBody()
    method testEnsuresDirExistsBeforeThrowingWarning (line 710) | public function testEnsuresDirExistsBeforeThrowingWarning()
    method testClosesIdleHandles (line 721) | public function testClosesIdleHandles()
    method testRejectsPromiseWhenCreateResponseFails (line 744) | public function testRejectsPromiseWhenCreateResponseFails()
    method testEnsuresOnHeadersIsCallable (line 758) | public function testEnsuresOnHeadersIsCallable()
    method testRejectsPromiseWhenOnHeadersFails (line 767) | public function testRejectsPromiseWhenOnHeadersFails()
    method testSuccessfullyCallsOnHeadersBeforeWritingToSink (line 786) | public function testSuccessfullyCallsOnHeadersBeforeWritingToSink()
    method testInvokesOnStatsOnSuccess (line 819) | public function testInvokesOnStatsOnSuccess()
    method testInvokesOnStatsOnError (line 846) | public function testInvokesOnStatsOnError()
    method testRewindsBodyIfPossible (line 873) | public function testRewindsBodyIfPossible()
    method testDoesNotRewindUnseekableBody (line 888) | public function testDoesNotRewindUnseekableBody()
    method testRelease (line 904) | public function testRelease()
    method testBodyEofOnWindows (line 916) | public function testBodyEofOnWindows()
    method testHandlesGarbageHttpServerGracefully (line 941) | public function testHandlesGarbageHttpServerGracefully()
    method testHandlesInvalidStatusCodeGracefully (line 951) | public function testHandlesInvalidStatusCodeGracefully()

FILE: tests/Handler/CurlHandlerTest.php
  class CurlHandlerTest (line 18) | class CurlHandlerTest extends TestCase
    method getHandler (line 20) | protected function getHandler($options = [])
    method testCreatesCurlErrors (line 25) | public function testCreatesCurlErrors()
    method testRedactsUserInfoInErrors (line 35) | public function testRedactsUserInfoInErrors()
    method testReusesHandles (line 48) | public function testReusesHandles()
    method testDoesSleep (line 59) | public function testDoesSleep()
    method testCreatesCurlErrorsWithContext (line 70) | public function testCreatesCurlErrorsWithContext()
    method testUsesContentLengthWhenOverInMemorySize (line 84) | public function testUsesContentLengthWhenOverInMemorySize()

FILE: tests/Handler/CurlMultiHandlerTest.php
  class CurlMultiHandlerTest (line 15) | class CurlMultiHandlerTest extends TestCase
    method setUp (line 17) | public function setUp(): void
    method tearDown (line 23) | public function tearDown(): void
    method testCanAddCustomCurlOptions (line 28) | public function testCanAddCustomCurlOptions()
    method testSendsRequest (line 40) | public function testSendsRequest()
    method testCreatesExceptions (line 49) | public function testCreatesExceptions()
    method testCanSetSelectTimeout (line 58) | public function testCanSetSelectTimeout()
    method testCanCancel (line 64) | public function testCanCancel()
    method testCannotCancelFinished (line 82) | public function testCannotCancelFinished()
    method testDelaysConcurrently (line 93) | public function testDelaysConcurrently()
    method testUsesTimeoutEnvironmentVariables (line 104) | public function testUsesTimeoutEnvironmentVariables()
    method throwsWhenAccessingInvalidProperty (line 123) | public function throwsWhenAccessingInvalidProperty()

FILE: tests/Handler/EasyHandleTest.php
  class EasyHandleTest (line 11) | class EasyHandleTest extends TestCase
    method testEnsuresHandleExists (line 13) | public function testEnsuresHandleExists()

FILE: tests/Handler/MockHandlerTest.php
  class MockHandlerTest (line 17) | class MockHandlerTest extends TestCase
    method testReturnsMockResponse (line 19) | public function testReturnsMockResponse()
    method testIsCountable (line 28) | public function testIsCountable()
    method testEmptyHandlerIsCountable (line 35) | public function testEmptyHandlerIsCountable()
    method testEnsuresEachAppendOnCreationIsValid (line 40) | public function testEnsuresEachAppendOnCreationIsValid()
    method testEnsuresEachAppendIsValid (line 46) | public function testEnsuresEachAppendIsValid()
    method testCanQueueExceptions (line 53) | public function testCanQueueExceptions()
    method testCanGetLastRequestAndOptions (line 67) | public function testCanGetLastRequestAndOptions()
    method testSinkFilename (line 77) | public function testSinkFilename()
    method testSinkResource (line 92) | public function testSinkResource()
    method testSinkStream (line 106) | public function testSinkStream()
    method testCanEnqueueCallables (line 119) | public function testCanEnqueueCallables()
    method testEnsuresOnHeadersIsCallable (line 131) | public function testEnsuresOnHeadersIsCallable()
    method testRejectsPromiseWhenOnHeadersFails (line 141) | public function testRejectsPromiseWhenOnHeadersFails()
    method testInvokesOnFulfilled (line 157) | public function testInvokesOnFulfilled()
    method testInvokesOnRejected (line 168) | public function testInvokesOnRejected()
    method testThrowsWhenNoMoreResponses (line 180) | public function testThrowsWhenNoMoreResponses()
    method testCanCreateWithDefaultMiddleware (line 189) | public function testCanCreateWithDefaultMiddleware()
    method testInvokesOnStatsFunctionForResponse (line 199) | public function testInvokesOnStatsFunctionForResponse()
    method testInvokesOnStatsFunctionForError (line 215) | public function testInvokesOnStatsFunctionForError()
    method testTransferTime (line 235) | public function testTransferTime()
    method testResetQueue (line 251) | public function testResetQueue()

FILE: tests/Handler/Network/StreamHandlerTest.php
  class StreamHandlerTest (line 15) | class StreamHandlerTest extends TestCase
    method setUp (line 17) | public function setUp(): void
    method testSslRequestWorks (line 24) | public function testSslRequestWorks()
    method testSslRequestWorksWithForceIpResolve (line 39) | public function testSslRequestWorksWithForceIpResolve()
    method testSslRequestWorksWithForceIpResolveAfterRedirect (line 55) | public function testSslRequestWorksWithForceIpResolveAfterRedirect()

FILE: tests/Handler/ProxyTest.php
  class ProxyTest (line 14) | class ProxyTest extends TestCase
    method testSendsToNonSync (line 16) | public function testSendsToNonSync()
    method testSendsToSync (line 31) | public function testSendsToSync()
    method testSendsToStreaming (line 46) | public function testSendsToStreaming()
    method testSendsToNonStreaming (line 61) | public function testSendsToNonStreaming()

FILE: tests/Handler/StreamHandlerTest.php
  class StreamHandlerTest (line 22) | class StreamHandlerTest extends TestCase
    method queueRes (line 24) | private function queueRes()
    method testReturnsResponseForSuccessfulRequest (line 35) | public function testReturnsResponseForSuccessfulRequest()
    method testAddsErrorToResponse (line 55) | public function testAddsErrorToResponse()
    method testStreamAttributeKeepsStreamOpen (line 66) | public function testStreamAttributeKeepsStreamOpen()
    method testDrainsResponseIntoTempStream (line 93) | public function testDrainsResponseIntoTempStream()
    method testDrainsResponseIntoSaveToBody (line 106) | public function testDrainsResponseIntoSaveToBody()
    method testDrainsResponseIntoSaveToBodyAtPath (line 120) | public function testDrainsResponseIntoSaveToBodyAtPath()
    method testDrainsResponseIntoSaveToBodyAtNonExistentPath (line 134) | public function testDrainsResponseIntoSaveToBodyAtNonExistentPath()
    method testDrainsResponseAndReadsOnlyContentLengthBytes (line 149) | public function testDrainsResponseAndReadsOnlyContentLengthBytes()
    method testDoesNotDrainWhenHeadRequest (line 167) | public function testDoesNotDrainWhenHeadRequest()
    method testAutomaticallyDecompressGzip (line 186) | public function testAutomaticallyDecompressGzip()
    method testAutomaticallyDecompressGzipHead (line 204) | public function testAutomaticallyDecompressGzipHead()
    method testReportsOriginalSizeAndContentEncodingAfterDecoding (line 222) | public function testReportsOriginalSizeAndContentEncodingAfterDecoding()
    method testDoesNotForceGzipDecode (line 246) | public function testDoesNotForceGzipDecode()
    method testProtocolVersion (line 264) | public function testProtocolVersion()
    method getSendResult (line 273) | protected function getSendResult(array $opts)
    method testAddsProxy (line 283) | public function testAddsProxy()
    method testAddsProxyByProtocol (line 291) | public function testAddsProxyByProtocol()
    method testAddsProxyButHonorsNoProxy (line 302) | public function testAddsProxyButHonorsNoProxy()
    method testUsesProxy (line 313) | public function testUsesProxy()
    method testAddsTimeout (line 328) | public function testAddsTimeout()
    method testVerifiesVerifyIsValidIfPath (line 335) | public function testVerifiesVerifyIsValidIfPath()
    method testVerifyCanBeDisabled (line 343) | public function testVerifyCanBeDisabled()
    method testVerifiesCertIfValidPath (line 349) | public function testVerifiesCertIfValidPath()
    method testVerifyCanBeSetToPath (line 357) | public function testVerifyCanBeSetToPath()
    method testUsesSystemDefaultBundle (line 368) | public function testUsesSystemDefaultBundle()
    method testEnsuresVerifyOptionIsValid (line 375) | public function testEnsuresVerifyOptionIsValid()
    method testEnsuresCryptoMethodOptionIsValid (line 383) | public function testEnsuresCryptoMethodOptionIsValid()
    method testSetsCryptoMethodTls10 (line 391) | public function testSetsCryptoMethodTls10()
    method testSetsCryptoMethodTls11 (line 398) | public function testSetsCryptoMethodTls11()
    method testSetsCryptoMethodTls12 (line 405) | public function testSetsCryptoMethodTls12()
    method testSetsCryptoMethodTls13 (line 415) | public function testSetsCryptoMethodTls13()
    method testCanSetPasswordWhenSettingCert (line 422) | public function testCanSetPasswordWhenSettingCert()
    method testDebugAttributeWritesToStream (line 431) | public function testDebugAttributeWritesToStream()
    method testDebugAttributeWritesStreamInfoToBuffer (line 443) | public function testDebugAttributeWritesStreamInfoToBuffer()
    method testEmitsProgressInformation (line 462) | public function testEmitsProgressInformation()
    method testEmitsProgressInformationAndDebugInformation (line 476) | public function testEmitsProgressInformationAndDebugInformation()
    method testPerformsShallowMergeOfCustomContextOptions (line 495) | public function testPerformsShallowMergeOfCustomContextOptions()
    method testEnsuresThatStreamContextIsAnArray (line 518) | public function testEnsuresThatStreamContextIsAnArray()
    method testDoesNotAddContentTypeByDefault (line 526) | public function testDoesNotAddContentTypeByDefault()
    method testAddsContentLengthByDefault (line 537) | public function testAddsContentLengthByDefault()
    method testAddsContentLengthForPUTEvenWhenEmpty (line 547) | public function testAddsContentLengthForPUTEvenWhenEmpty()
    method testAddsContentLengthForPOSTEvenWhenEmpty (line 557) | public function testAddsContentLengthForPOSTEvenWhenEmpty()
    method testDontAddContentLengthForGETEvenWhenEmpty (line 567) | public function testDontAddContentLengthForGETEvenWhenEmpty()
    method testSupports100Continue (line 577) | public function testSupports100Continue()
    method testDoesSleep (line 591) | public function testDoesSleep()
    method testEnsuresOnHeadersIsCallable (line 602) | public function testEnsuresOnHeadersIsCallable()
    method testRejectsPromiseWhenOnHeadersFails (line 611) | public function testRejectsPromiseWhenOnHeadersFails()
    method testSuccessfullyCallsOnHeadersBeforeWritingToSink (line 630) | public function testSuccessfullyCallsOnHeadersBeforeWritingToSink()
    method testInvokesOnStatsOnSuccess (line 663) | public function testInvokesOnStatsOnSuccess()
    method testInvokesOnStatsOnError (line 689) | public function testInvokesOnStatsOnError()
    method testStreamIgnoresZeroTimeout (line 718) | public function testStreamIgnoresZeroTimeout()
    method testDrainsResponseAndReadsAllContentWhenContentLengthIsZero (line 733) | public function testDrainsResponseAndReadsAllContentWhenContentLengthI...
    method testHonorsReadTimeout (line 751) | public function testHonorsReadTimeout()
    method testHandlesGarbageHttpServerGracefully (line 773) | public function testHandlesGarbageHttpServerGracefully()
    method testHandlesInvalidStatusCodeGracefully (line 792) | public function testHandlesInvalidStatusCodeGracefully()
    method testRejectsNonHttpSchemes (line 807) | public function testRejectsNonHttpSchemes()

FILE: tests/HandlerStackTest.php
  class HandlerStackTest (line 12) | class HandlerStackTest extends TestCase
    method testSetsHandlerInCtor (line 14) | public function testSetsHandlerInCtor()
    method testCanSetDifferentHandlerAfterConstruction (line 27) | public function testCanSetDifferentHandlerAfterConstruction()
    method testEnsuresHandlerIsSet (line 36) | public function testEnsuresHandlerIsSet()
    method testPushInOrder (line 44) | public function testPushInOrder()
    method testUnshiftsInReverseOrder (line 60) | public function testUnshiftsInReverseOrder()
    method testCanRemoveMiddlewareByInstance (line 76) | public function testCanRemoveMiddlewareByInstance()
    method testCanPrintMiddleware (line 91) | public function testCanPrintMiddleware()
    method testCanAddBeforeByName (line 112) | public function testCanAddBeforeByName()
    method testEnsuresHandlerExistsByName (line 128) | public function testEnsuresHandlerExistsByName()
    method testCanAddAfterByName (line 137) | public function testCanAddAfterByName()
    method testPicksUpCookiesFromRedirects (line 153) | public function testPicksUpCookiesFromRedirects()
    method getFunctions (line 175) | private function getFunctions()
    method foo (line 210) | public static function foo()
    method bar (line 214) | public function bar()

FILE: tests/Helpers.php
  class Helpers (line 5) | class Helpers
    method readObjectAttribute (line 7) | public static function readObjectAttribute(object $object, string $att...

FILE: tests/HttplugIntegrationTest.php
  class HttplugIntegrationTest (line 12) | class HttplugIntegrationTest extends HttpClientTest
    method createHttpAdapter (line 14) | protected function createHttpAdapter(): ClientInterface

FILE: tests/InternalUtilsTest.php
  class InternalUtilsTest (line 9) | class InternalUtilsTest extends TestCase
    method testCurrentTime (line 11) | public function testCurrentTime()
    method testIdnConvert (line 19) | public function testIdnConvert()

FILE: tests/MessageFormatterTest.php
  class MessageFormatterTest (line 15) | class MessageFormatterTest extends TestCase
    method testCreatesWithClfByDefault (line 17) | public function testCreatesWithClfByDefault()
    method dateProvider (line 25) | public static function dateProvider()
    method testFormatsTimestamps (line 37) | public function testFormatsTimestamps(string $format, string $pattern)
    method formatProvider (line 51) | public static function formatProvider()
    method testFormatsMessages (line 95) | public function testFormatsMessages(string $template, array $args, $re...

FILE: tests/MiddlewareTest.php
  class MiddlewareTest (line 23) | class MiddlewareTest extends TestCase
    method testAddsCookiesToRequests (line 25) | public function testAddsCookiesToRequests()
    method testThrowsExceptionOnHttpClientError (line 47) | public function testThrowsExceptionOnHttpClientError()
    method testThrowsExceptionOnHttpClientErrorLongBody (line 60) | public function testThrowsExceptionOnHttpClientErrorLongBody()
    method testThrowsExceptionOnHttpServerError (line 73) | public function testThrowsExceptionOnHttpServerError()
    method testTracksHistory (line 89) | public function testTracksHistory($container)
    method testNullContainerException (line 110) | public function testNullContainerException()
    method getHistoryUseCases (line 118) | public static function getHistoryUseCases()
    method testTracksHistoryForFailures (line 126) | public function testTracksHistoryForFailures()
    method testTapsBeforeAndAfter (line 139) | public function testTapsBeforeAndAfter()
    method testMapsRequest (line 170) | public function testMapsRequest()
    method testMapsResponse (line 188) | public function testMapsResponse()
    method testLogsRequestsAndResponses (line 201) | public function testLogsRequestsAndResponses()
    method testLogsRequestsAndResponsesCustomLevel (line 215) | public function testLogsRequestsAndResponsesCustomLevel()
    method testLogsRequestsAndErrors (line 230) | public function testLogsRequestsAndErrors()
    method testLogsWithStringError (line 246) | public function testLogsWithStringError()

FILE: tests/PoolTest.php
  class PoolTest (line 16) | class PoolTest extends TestCase
    method testValidatesIterable (line 18) | public function testValidatesIterable()
    method testValidatesEachElement (line 26) | public function testValidatesEachElement()
    method testSendsAndRealizesFuture (line 39) | public function testSendsAndRealizesFuture()
    method testExecutesPendingWhenWaiting (line 49) | public function testExecutesPendingWhenWaiting()
    method testUsesRequestOptions (line 70) | public function testUsesRequestOptions()
    method testCanProvideCallablesThatReturnResponses (line 88) | public function testCanProvideCallablesThatReturnResponses()
    method testBatchesResults (line 112) | public function testBatchesResults()
    method testBatchesResultsWithCallbacks (line 135) | public function testBatchesResultsWithCallbacks()
    method testUsesYieldedKeyInFulfilledCallback (line 156) | public function testUsesYieldedKeyInFulfilledCallback()
    method getClient (line 186) | private function getClient($total = 1)

FILE: tests/PrepareBodyMiddlewareTest.php
  class PrepareBodyMiddlewareTest (line 16) | class PrepareBodyMiddlewareTest extends TestCase
    method methodProvider (line 18) | public static function methodProvider()
    method testAddsContentLengthWhenMissingAndPossible (line 32) | public function testAddsContentLengthWhenMissingAndPossible($method, $...
    method testAddsTransferEncodingWhenNoContentLength (line 56) | public function testAddsTransferEncodingWhenNoContentLength()
    method testAddsContentTypeWhenMissingAndPossible (line 81) | public function testAddsContentTypeWhenMissingAndPossible()
    method expectProvider (line 102) | public static function expectProvider()
    method testAddsExpect (line 115) | public function testAddsExpect($value, $result)
    method testIgnoresIfExpectIsPresent (line 139) | public function testIgnoresIfExpectIsPresent()

FILE: tests/RedirectMiddlewareTest.php
  class RedirectMiddlewareTest (line 20) | class RedirectMiddlewareTest extends TestCase
    method testIgnoresNonRedirects (line 22) | public function testIgnoresNonRedirects()
    method testIgnoresWhenNoLocation (line 34) | public function testIgnoresWhenNoLocation()
    method testRedirectsWithAbsoluteUri (line 46) | public function testRedirectsWithAbsoluteUri()
    method testRedirectsWithRelativeUri (line 64) | public function testRedirectsWithRelativeUri()
    method testLimitsToMaxRedirects (line 82) | public function testLimitsToMaxRedirects()
    method testTooManyRedirectsExceptionHasResponse (line 101) | public function testTooManyRedirectsExceptionHasResponse()
    method testEnsuresProtocolIsValid (line 121) | public function testEnsuresProtocolIsValid()
    method testAddsRefererHeader (line 136) | public function testAddsRefererHeader()
    method testAddsRefererHeaderButClearsUserInfo (line 156) | public function testAddsRefererHeaderButClearsUserInfo()
    method testAddsGuzzleRedirectHeader (line 176) | public function testAddsGuzzleRedirectHeader()
    method testAddsGuzzleRedirectStatusHeader (line 203) | public function testAddsGuzzleRedirectStatusHeader()
    method testDoesNotAddRefererWhenGoingFromHttpsToHttp (line 232) | public function testDoesNotAddRefererWhenGoingFromHttpsToHttp()
    method testInvokesOnRedirectForRedirects (line 249) | public function testInvokesOnRedirectForRedirects()
    method testRemoveCurlAuthorizationOptionsOnRedirectCrossHost (line 279) | public function testRemoveCurlAuthorizationOptionsOnRedirectCrossHost(...
    method testRemoveCurlAuthorizationOptionsOnRedirectCrossPort (line 309) | public function testRemoveCurlAuthorizationOptionsOnRedirectCrossPort(...
    method testRemoveCurlAuthorizationOptionsOnRedirectCrossScheme (line 339) | public function testRemoveCurlAuthorizationOptionsOnRedirectCrossSchem...
    method testRemoveCurlAuthorizationOptionsOnRedirectCrossSchemeSamePort (line 369) | public function testRemoveCurlAuthorizationOptionsOnRedirectCrossSchem...
    method testNotRemoveCurlAuthorizationOptionsOnRedirect (line 399) | public function testNotRemoveCurlAuthorizationOptionsOnRedirect($auth)
    method crossOriginRedirectProvider (line 425) | public static function crossOriginRedirectProvider()
    method testHeadersTreatmentOnRedirect (line 450) | public function testHeadersTreatmentOnRedirect($originalUri, $targetUr...
    method testNotRemoveAuthorizationHeaderOnRedirect (line 466) | public function testNotRemoveAuthorizationHeaderOnRedirect()
    method testModifyRequestFollowRequestMethodAndBody (line 489) | public function testModifyRequestFollowRequestMethodAndBody(
    method modifyRequestFollowRequyestMethodAndBodyProvider (line 513) | public static function modifyRequestFollowRequyestMethodAndBodyProvider()

FILE: tests/RetryMiddlewareTest.php
  class RetryMiddlewareTest (line 13) | class RetryMiddlewareTest extends TestCase
    method testRetriesWhenDeciderReturnsTrue (line 15) | public function testRetriesWhenDeciderReturnsTrue()
    method testDoesNotRetryWhenDeciderReturnsFalse (line 43) | public function testDoesNotRetryWhenDeciderReturnsFalse()
    method testCanRetryExceptions (line 55) | public function testCanRetryExceptions()
    method testBackoffCalculateDelay (line 77) | public function testBackoffCalculateDelay()

FILE: tests/Server.php
  class Server (line 23) | class Server
    method flush (line 38) | public static function flush()
    method enqueue (line 54) | public static function enqueue($responses)
    method enqueueRaw (line 88) | public static function enqueueRaw($statusCode, $reasonPhrase, $headers...
    method received (line 111) | public static function received()
    method stop (line 147) | public static function stop()
    method wait (line 156) | public static function wait($maxTries = 5)
    method start (line 168) | public static function start()
    method isListening (line 183) | private static function isListening()
    method getClient (line 197) | private static function getClient()

FILE: tests/TestLogger.php
  class TestLogger (line 12) | class TestLogger extends AbstractLogger
    method log (line 17) | public function log($level, $message, array $context = []): void
    method hasRecords (line 29) | public function hasRecords($level)
    method hasRecord (line 34) | public function hasRecord($record, $level)
    method hasRecordThatContains (line 52) | public function hasRecordThatContains($message, $level)
    method hasRecordThatMatches (line 59) | public function hasRecordThatMatches($regex, $level)
    method hasRecordThatPasses (line 66) | public function hasRecordThatPasses(callable $predicate, $level)
    method __call (line 80) | public function __call($method, $args)
    method reset (line 94) | public function reset()

FILE: tests/TransferStatsTest.php
  class TransferStatsTest (line 9) | class TransferStatsTest extends TestCase
    method testHasData (line 11) | public function testHasData()

FILE: tests/UtilsTest.php
  class UtilsTest (line 9) | class UtilsTest extends TestCase
    method noBodyProvider (line 11) | public static function noBodyProvider()
    method typeProvider (line 16) | public static function typeProvider()
    method testDescribesType (line 32) | public function testDescribesType($input, $output)
    method testParsesHeadersFromLines (line 54) | public function testParsesHeadersFromLines()
    method testParsesHeadersFromLinesWithMultipleLines (line 73) | public function testParsesHeadersFromLinesWithMultipleLines()
    method testChooseHandler (line 82) | public function testChooseHandler()
    method testDefaultUserAgent (line 88) | public function testDefaultUserAgent()
    method testReturnsDebugResource (line 94) | public function testReturnsDebugResource()
    method testProvidesDefaultCaBundler (line 100) | public function testProvidesDefaultCaBundler()
    method testNormalizeHeaderKeys (line 106) | public function testNormalizeHeaderKeys()
    method noProxyProvider (line 115) | public static function noProxyProvider()
    method testChecksNoProxyList (line 131) | public function testChecksNoProxyList($host, $list, $result)
    method testEnsuresNoProxyCheckHostIsSet (line 137) | public function testEnsuresNoProxyCheckHostIsSet()
    method testEnsuresNoProxyCheckHostIsSetLegacy (line 144) | public function testEnsuresNoProxyCheckHostIsSetLegacy()
    method testEncodesJson (line 151) | public function testEncodesJson()
    method testEncodesJsonAndThrowsOnError (line 157) | public function testEncodesJsonAndThrowsOnError()
    method testEncodesJsonAndThrowsOnErrorLegacy (line 164) | public function testEncodesJsonAndThrowsOnErrorLegacy()
    method testDecodesJson (line 171) | public function testDecodesJson()
    method testDecodesJsonAndThrowsOnError (line 177) | public function testDecodesJsonAndThrowsOnError()
    method testDecodesJsonAndThrowsOnErrorLegacy (line 184) | public function testDecodesJsonAndThrowsOnErrorLegacy()
  class StrClass (line 192) | final class StrClass
    method __toString (line 194) | public function __toString()

FILE: tests/bootstrap.php
  function curl_setopt_array (line 22) | function curl_setopt_array($handle, array $options)
  function curl_multi_setopt (line 33) | function curl_multi_setopt($handle, $option, $value)
Condensed preview — 110 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (825K chars).
[
  {
    "path": ".editorconfig",
    "chars": 343,
    "preview": "# EditorConfig is awesome: https://editorconfig.org/\n\n# top-most EditorConfig file\nroot = true\n\n# Unix-style newlines wi"
  },
  {
    "path": ".gitattributes",
    "chars": 555,
    "preview": ".editorconfig          export-ignore\n.gitattributes         export-ignore\n/.github/              export-ignore\n.gitignor"
  },
  {
    "path": ".github/.editorconfig",
    "chars": 24,
    "preview": "[*.yml]\nindent_size = 2\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "chars": 73,
    "preview": "github: [Nyholm, GrahamCampbell]\ntidelift: \"packagist/guzzlehttp/guzzle\"\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "chars": 577,
    "preview": "---\nname: 🐛 Bug Report\nabout: Report errors and problems\n---\n\n**Guzzle version(s) affected**: x.y.z\n**PHP version**: x.y"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/config.yml",
    "chars": 340,
    "preview": "blank_issues_enabled: false\ncontact_links:\n  - name: 📚Documentation\n    url: https://docs.guzzlephp.org/en/stable/\n    a"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "chars": 468,
    "preview": "---\nname: 🚀 Feature Request\nabout: RFC and ideas for new features and improvements\n---\n\n**Description**\n<!-- A clear and"
  },
  {
    "path": ".github/stale.yml",
    "chars": 557,
    "preview": "daysUntilStale: 120\ndaysUntilClose: 14\nexemptLabels:\n  - lifecycle/keep-open\n  - lifecycle/ready-for-merge\n# Label to us"
  },
  {
    "path": ".github/workflows/checks.yml",
    "chars": 337,
    "preview": "name: Checks\n\non:\n  push:\n    branches:\n  pull_request:\n\npermissions:\n  contents: read\n\njobs:\n  composer-normalize:\n    "
  },
  {
    "path": ".github/workflows/ci.yml",
    "chars": 3294,
    "preview": "name: CI\n\non:\n  push:\n    branches:\n  pull_request:\n\npermissions:\n  contents: read\n\njobs:\n  build-lowest-version:\n    na"
  },
  {
    "path": ".github/workflows/static.yml",
    "chars": 1297,
    "preview": "name: Static analysis\n\non:\n  push:\n    branches:\n  pull_request:\n\npermissions:\n  contents: read\n\njobs:\n  phpstan:\n    na"
  },
  {
    "path": ".gitignore",
    "chars": 151,
    "preview": ".php-cs-fixer.php\n.php-cs-fixer.cache\n.phpunit.result.cache\ncomposer.lock\nvendor/\n/phpstan.neon\n/phpunit.xml\n\nbuild/\nart"
  },
  {
    "path": ".php-cs-fixer.dist.php",
    "chars": 812,
    "preview": "<?php\n\n$config = (new PhpCsFixer\\Config())\n    ->setRiskyAllowed(true)\n    ->setRules([\n        '@PHP71Migration:risky' "
  },
  {
    "path": "CHANGELOG.md",
    "chars": 88102,
    "preview": "# Change Log\n\nPlease refer to [UPGRADING](UPGRADING.md) guide for upgrading to a major version.\n\n## 7.10.0 - 2025-08-23\n"
  },
  {
    "path": "Dockerfile",
    "chars": 346,
    "preview": "FROM composer:latest as setup\n\nWORKDIR /guzzle\n\nRUN set -xe \\\n    && composer init --name=guzzlehttp/test --description="
  },
  {
    "path": "LICENSE",
    "chars": 1457,
    "preview": "The MIT License (MIT)\n\nCopyright (c) 2011 Michael Dowling <mtdowling@gmail.com>\nCopyright (c) 2012 Jeremy Lindblom <jere"
  },
  {
    "path": "Makefile",
    "chars": 2734,
    "preview": "help:\n\t@echo \"Please use \\`make <target>' where <target> is one of\"\n\t@echo \"  start-server                   to start th"
  },
  {
    "path": "README.md",
    "chars": 5034,
    "preview": "![Guzzle](.github/logo.png?raw=true)\n\n# Guzzle, PHP HTTP client\n\n[![Latest Version](https://img.shields.io/github/releas"
  },
  {
    "path": "UPGRADING.md",
    "chars": 53625,
    "preview": "Guzzle Upgrade Guide\n====================\n\n6.0 to 7.0\n----------\n\nIn order to take advantage of the new features of PHP,"
  },
  {
    "path": "composer.json",
    "chars": 3851,
    "preview": "{\n    \"name\": \"guzzlehttp/guzzle\",\n    \"description\": \"Guzzle is a PHP HTTP client library\",\n    \"keywords\": [\n        \""
  },
  {
    "path": "docs/Makefile",
    "chars": 5564,
    "preview": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD "
  },
  {
    "path": "docs/conf.py",
    "chars": 2008,
    "preview": "import sys, os\nfrom sphinx.highlighting import lexers\nfrom pygments.lexers.web import PhpLexer\n\n\nlexers['php'] = PhpLexe"
  },
  {
    "path": "docs/faq.rst",
    "chars": 7134,
    "preview": "===\nFAQ\n===\n\nDoes Guzzle require cURL?\n=========================\n\nNo. Guzzle can use any HTTP handler to send requests. "
  },
  {
    "path": "docs/handlers-and-middleware.rst",
    "chars": 10109,
    "preview": "=======================\nHandlers and Middleware\n=======================\n\nGuzzle clients use a handler and middleware sys"
  },
  {
    "path": "docs/index.rst",
    "chars": 1651,
    "preview": ".. title:: Guzzle, PHP HTTP client\n\n====================\nGuzzle Documentation\n====================\n\nGuzzle is a PHP HTTP"
  },
  {
    "path": "docs/overview.rst",
    "chars": 5259,
    "preview": "========\nOverview\n========\n\nRequirements\n============\n\n#. PHP 7.2.5\n#. To use the PHP stream handler, ``allow_url_fopen`"
  },
  {
    "path": "docs/psr7.rst",
    "chars": 13644,
    "preview": "================\nGuzzle and PSR-7\n================\n\nGuzzle utilizes PSR-7 as the HTTP message interface. This allows Guz"
  },
  {
    "path": "docs/quickstart.rst",
    "chars": 20260,
    "preview": "==========\nQuickstart\n==========\n\nThis page provides a quick introduction to Guzzle and introductory examples.\nIf you ha"
  },
  {
    "path": "docs/request-options.rst",
    "chars": 33815,
    "preview": "===============\nRequest Options\n===============\n\nYou can customize requests created and transferred by a client using\n**"
  },
  {
    "path": "docs/requirements.txt",
    "chars": 79,
    "preview": "Sphinx>=1.3.0,<1.4.0\nguzzle_sphinx_theme>=0.7.0,<0.8.0\njinja2<3\nmarkupsafe<2.1\n"
  },
  {
    "path": "docs/testing.rst",
    "chars": 6919,
    "preview": "======================\nTesting Guzzle Clients\n======================\n\nGuzzle provides several tools that will enable you"
  },
  {
    "path": "phpstan-baseline.neon",
    "chars": 43777,
    "preview": "parameters:\n\tignoreErrors:\n\t\t-\n\t\t\tmessage: '#^Argument of an invalid type mixed supplied for foreach, only iterables are"
  },
  {
    "path": "phpstan.neon.dist",
    "chars": 302,
    "preview": "includes:\n    - phpstan-baseline.neon\n    - vendor-bin/phpstan/vendor/phpstan/phpstan-deprecation-rules/rules.neon\n\npara"
  },
  {
    "path": "phpunit.xml.dist",
    "chars": 853,
    "preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n  <phpunit xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\n           xsi:n"
  },
  {
    "path": "src/BodySummarizer.php",
    "chars": 608,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse Psr\\Http\\Message\\MessageInterface;\n\nfinal class BodySummarizer implements BodySummariz"
  },
  {
    "path": "src/BodySummarizerInterface.php",
    "chars": 233,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse Psr\\Http\\Message\\MessageInterface;\n\ninterface BodySummarizerInterface\n{\n    /**\n     *"
  },
  {
    "path": "src/Client.php",
    "chars": 18436,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Cookie\\CookieJar;\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse GuzzleHttp\\"
  },
  {
    "path": "src/ClientInterface.php",
    "chars": 2901,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr"
  },
  {
    "path": "src/ClientTrait.php",
    "chars": 9006,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Exception\\GuzzleException;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr"
  },
  {
    "path": "src/Cookie/CookieJar.php",
    "chars": 9535,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Cookie;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**"
  },
  {
    "path": "src/Cookie/CookieJarInterface.php",
    "chars": 2829,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Cookie;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n/**"
  },
  {
    "path": "src/Cookie/FileCookieJar.php",
    "chars": 2758,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Cookie;\n\nuse GuzzleHttp\\Utils;\n\n/**\n * Persists non-session cookies using a JSON formatted f"
  },
  {
    "path": "src/Cookie/SessionCookieJar.php",
    "chars": 2003,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Cookie;\n\n/**\n * Persists cookies in the client session\n */\nclass SessionCookieJar extends Co"
  },
  {
    "path": "src/Cookie/SetCookie.php",
    "chars": 14515,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Cookie;\n\n/**\n * Set-Cookie object\n */\nclass SetCookie\n{\n    /**\n     * @var array\n     */\n  "
  },
  {
    "path": "src/Exception/BadResponseException.php",
    "chars": 982,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\n"
  },
  {
    "path": "src/Exception/ClientException.php",
    "chars": 163,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\n/**\n * Exception when a client error is encountered (4xx codes)\n */\nclass Client"
  },
  {
    "path": "src/Exception/ConnectException.php",
    "chars": 1409,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nuse Psr\\Http\\Client\\NetworkExceptionInterface;\nuse Psr\\Http\\Message\\RequestInter"
  },
  {
    "path": "src/Exception/GuzzleException.php",
    "chars": 150,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nuse Psr\\Http\\Client\\ClientExceptionInterface;\n\ninterface GuzzleException extends"
  },
  {
    "path": "src/Exception/InvalidArgumentException.php",
    "chars": 142,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nfinal class InvalidArgumentException extends \\InvalidArgumentException implement"
  },
  {
    "path": "src/Exception/RequestException.php",
    "chars": 4441,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nuse GuzzleHttp\\BodySummarizer;\nuse GuzzleHttp\\BodySummarizerInterface;\nuse Psr\\H"
  },
  {
    "path": "src/Exception/ServerException.php",
    "chars": 163,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\n/**\n * Exception when a server error is encountered (5xx codes)\n */\nclass Server"
  },
  {
    "path": "src/Exception/TooManyRedirectsException.php",
    "chars": 101,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nclass TooManyRedirectsException extends RequestException\n{\n}\n"
  },
  {
    "path": "src/Exception/TransferException.php",
    "chars": 121,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Exception;\n\nclass TransferException extends \\RuntimeException implements GuzzleException\n{\n}"
  },
  {
    "path": "src/Handler/CurlFactory.php",
    "chars": 28271,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestExcepti"
  },
  {
    "path": "src/Handler/CurlFactoryInterface.php",
    "chars": 657,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse Psr\\Http\\Message\\RequestInterface;\n\ninterface CurlFactoryInterface\n{\n    /**\n "
  },
  {
    "path": "src/Handler/CurlHandler.php",
    "chars": 1330,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/"
  },
  {
    "path": "src/Handler/CurlMultiHandler.php",
    "chars": 8749,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse Closure;\nuse GuzzleHttp\\Promise as P;\nuse GuzzleHttp\\Promise\\Promise;\nuse Guzz"
  },
  {
    "path": "src/Handler/EasyHandle.php",
    "chars": 2900,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Psr7\\Response;\nuse GuzzleHttp\\Utils;\nuse Psr\\Http\\Message\\RequestIn"
  },
  {
    "path": "src/Handler/HeaderProcessor.php",
    "chars": 1056,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Utils;\n\n/**\n * @internal\n */\nfinal class HeaderProcessor\n{\n    /**\n"
  },
  {
    "path": "src/Handler/MockHandler.php",
    "chars": 6402,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\HandlerStack;\nuse Guzzle"
  },
  {
    "path": "src/Handler/Proxy.php",
    "chars": 2058,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse GuzzleHttp\\RequestOptions;\nuse Psr\\Ht"
  },
  {
    "path": "src/Handler/StreamHandler.php",
    "chars": 22145,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestExcepti"
  },
  {
    "path": "src/HandlerStack.php",
    "chars": 8712,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Ht"
  },
  {
    "path": "src/MessageFormatter.php",
    "chars": 7797,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse Psr\\Http\\Message\\MessageInterface;\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http"
  },
  {
    "path": "src/MessageFormatterInterface.php",
    "chars": 561,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\n\ninterface "
  },
  {
    "path": "src/Middleware.php",
    "chars": 11159,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Cookie\\CookieJarInterface;\nuse GuzzleHttp\\Exception\\RequestException;\nuse G"
  },
  {
    "path": "src/Pool.php",
    "chars": 4704,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Promise as P;\nuse GuzzleHttp\\Promise\\EachPromise;\nuse GuzzleHttp\\Promise\\Pr"
  },
  {
    "path": "src/PrepareBodyMiddleware.php",
    "chars": 3127,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message\\RequestInterface;\n\n/**\n * Pr"
  },
  {
    "path": "src/RedirectMiddleware.php",
    "chars": 8100,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Exception\\BadResponseException;\nuse GuzzleHttp\\Exception\\TooManyRedirectsEx"
  },
  {
    "path": "src/RequestOptions.php",
    "chars": 10958,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\n/**\n * This class contains a list of built-in Guzzle request options.\n *\n * @see https://d"
  },
  {
    "path": "src/RetryMiddleware.php",
    "chars": 3615,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Promise as P;\nuse GuzzleHttp\\Promise\\PromiseInterface;\nuse Psr\\Http\\Message"
  },
  {
    "path": "src/TransferStats.php",
    "chars": 3180,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse Psr\\Http\\Message\\RequestInterface;\nuse Psr\\Http\\Message\\ResponseInterface;\nuse Psr\\Htt"
  },
  {
    "path": "src/Utils.php",
    "chars": 13159,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\nuse GuzzleHttp\\Exception\\InvalidArgumentException;\nuse GuzzleHttp\\Handler\\CurlHandler;\nuse"
  },
  {
    "path": "src/functions.php",
    "chars": 5676,
    "preview": "<?php\n\nnamespace GuzzleHttp;\n\n/**\n * Debug function used to describe the provided value type and class.\n *\n * @param mix"
  },
  {
    "path": "src/functions_include.php",
    "chars": 160,
    "preview": "<?php\n\n// Don't redefine the functions if included multiple times.\nif (!\\function_exists('GuzzleHttp\\describe_type')) {\n"
  },
  {
    "path": "tests/ClientTest.php",
    "chars": 31100,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Cookie\\CookieJar;\nuse GuzzleHttp\\Handler\\MockH"
  },
  {
    "path": "tests/Cookie/CookieJarTest.php",
    "chars": 16282,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\CookieJar;\n\nuse DateInterval;\nuse DateTime;\nuse DateTimeImmutable;\nuse GuzzleHttp\\Cook"
  },
  {
    "path": "tests/Cookie/FileCookieJarTest.php",
    "chars": 3767,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\CookieJar;\n\nuse GuzzleHttp\\Cookie\\FileCookieJar;\nuse GuzzleHttp\\Cookie\\SetCookie;\nuse "
  },
  {
    "path": "tests/Cookie/SessionCookieJarTest.php",
    "chars": 2372,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\CookieJar;\n\nuse GuzzleHttp\\Cookie\\SessionCookieJar;\nuse GuzzleHttp\\Cookie\\SetCookie;\nu"
  },
  {
    "path": "tests/Cookie/SetCookieTest.php",
    "chars": 17741,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\CookieJar;\n\nuse GuzzleHttp\\Cookie\\SetCookie;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * @"
  },
  {
    "path": "tests/Exception/BadResponseExceptionTest.php",
    "chars": 723,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\Exception;\n\nuse GuzzleHttp\\Exception\\BadResponseException;\nuse GuzzleHttp\\Psr7\\Request"
  },
  {
    "path": "tests/Exception/ConnectExceptionTest.php",
    "chars": 908,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\Exception;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Psr7\\Request;\nus"
  },
  {
    "path": "tests/Exception/RequestExceptionTest.php",
    "chars": 6344,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\Exception;\n\nuse GuzzleHttp\\Exception\\ClientException;\nuse GuzzleHttp\\Exception\\Request"
  },
  {
    "path": "tests/Handler/CurlFactoryTest.php",
    "chars": 34999,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestEx"
  },
  {
    "path": "tests/Handler/CurlHandlerTest.php",
    "chars": 3272,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Handler\\CurlHandler"
  },
  {
    "path": "tests/Handler/CurlMultiHandlerTest.php",
    "chars": 3958,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Handler\\CurlMultiH"
  },
  {
    "path": "tests/Handler/EasyHandleTest.php",
    "chars": 488,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Handler\\EasyHandle;\nuse PHPUnit\\Framework\\TestCase;\n\n/**\n * @c"
  },
  {
    "path": "tests/Handler/MockHandlerTest.php",
    "chars": 8037,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Exception\\BadResponseException;\nuse GuzzleHttp\\Exception\\Reque"
  },
  {
    "path": "tests/Handler/Network/StreamHandlerTest.php",
    "chars": 2186,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler\\Network;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Handler\\StreamHandler;\nuse Guzz"
  },
  {
    "path": "tests/Handler/ProxyTest.php",
    "chars": 2072,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Handler\\MockHandler;\nuse GuzzleHttp\\Handler\\Proxy;\nuse GuzzleH"
  },
  {
    "path": "tests/Handler/StreamHandlerTest.php",
    "chars": 29220,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test\\Handler;\n\nuse GuzzleHttp\\Exception\\ConnectException;\nuse GuzzleHttp\\Exception\\RequestEx"
  },
  {
    "path": "tests/HandlerStackTest.php",
    "chars": 7393,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Cookie\\CookieJar;\nuse GuzzleHttp\\Handler\\MockHandler;\nuse GuzzleHttp\\"
  },
  {
    "path": "tests/Helpers.php",
    "chars": 1084,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nclass Helpers\n{\n    public static function readObjectAttribute(object $object, strin"
  },
  {
    "path": "tests/HttplugIntegrationTest.php",
    "chars": 351,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse Http\\Client\\Tests\\HttpClientTest;\nuse Psr\\Http\\Client\\Cli"
  },
  {
    "path": "tests/InternalUtilsTest.php",
    "chars": 536,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\Utils;\nuse PHPUnit\\Framework\\TestCase;\n\nclass Int"
  },
  {
    "path": "tests/MessageFormatterTest.php",
    "chars": 4122,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Exception\\RequestException;\nuse GuzzleHttp\\MessageFormatter;\nuse Guzz"
  },
  {
    "path": "tests/MiddlewareTest.php",
    "chars": 9864,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\BodySummarizer;\nuse GuzzleHttp\\Cookie\\CookieJar;\nuse GuzzleHttp\\Cooki"
  },
  {
    "path": "tests/PoolTest.php",
    "chars": 6379,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Exception\\ClientException;\nuse GuzzleHttp\\Hand"
  },
  {
    "path": "tests/PrepareBodyMiddlewareTest.php",
    "chars": 5337,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Handler\\MockHandler;\nuse GuzzleHttp\\HandlerStack;\nuse GuzzleHttp\\Midd"
  },
  {
    "path": "tests/RedirectMiddlewareTest.php",
    "chars": 20420,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Exception\\BadResponseException;\nuse GuzzleHttp"
  },
  {
    "path": "tests/RetryMiddlewareTest.php",
    "chars": 2993,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Handler\\MockHandler;\nuse GuzzleHttp\\Middleware"
  },
  {
    "path": "tests/Server.php",
    "chars": 6053,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Client;\nuse GuzzleHttp\\Psr7;\nuse Psr\\Http\\Message\\ResponseInterface;\n"
  },
  {
    "path": "tests/TestLogger.php",
    "chars": 2736,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse Psr\\Log\\AbstractLogger;\n\n/**\n * Used for testing purposes.\n *\n * It records all "
  },
  {
    "path": "tests/TransferStatsTest.php",
    "chars": 964,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Tests;\n\nuse GuzzleHttp\\Psr7;\nuse GuzzleHttp\\TransferStats;\nuse PHPUnit\\Framework\\TestCase;\n\n"
  },
  {
    "path": "tests/UtilsTest.php",
    "chars": 5438,
    "preview": "<?php\n\nnamespace GuzzleHttp\\Test;\n\nuse GuzzleHttp;\nuse GuzzleHttp\\Utils;\nuse PHPUnit\\Framework\\TestCase;\n\nclass UtilsTes"
  },
  {
    "path": "tests/bootstrap-phpstan.php",
    "chars": 164,
    "preview": "<?php\n\nif (!\\defined('IDNA_DEFAULT')) {\n    \\define('IDNA_DEFAULT', 0);\n}\n\nif (!\\defined('INTL_IDNA_VARIANT_UTS46')) {\n "
  },
  {
    "path": "tests/bootstrap.php",
    "chars": 1036,
    "preview": "<?php\n\nnamespace {\n    \\setlocale(\\LC_ALL, 'C');\n    \\error_reporting(\\E_ALL);\n}\n\nnamespace GuzzleHttp\\Test {\n    requir"
  },
  {
    "path": "tests/server.js",
    "chars": 8050,
    "preview": "/**\n * Guzzle node.js test server to return queued responses to HTTP requests and\n * expose a RESTful API for enqueueing"
  },
  {
    "path": "vendor-bin/php-cs-fixer/composer.json",
    "chars": 155,
    "preview": "{\n    \"require\": {\n        \"php\": \"^7.4\",\n        \"friendsofphp/php-cs-fixer\": \"3.94.2\"\n    },\n    \"config\": {\n        \""
  },
  {
    "path": "vendor-bin/phpstan/composer.json",
    "chars": 199,
    "preview": "{\n    \"require\": {\n        \"php\": \"^8.2\",\n        \"phpstan/phpstan\": \"2.1.40\",\n        \"phpstan/phpstan-deprecation-rule"
  }
]

About this extraction

This page contains the full source code of the guzzle/guzzle GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 110 files (768.6 KB), approximately 193.8k tokens, and a symbol index with 760 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!