diff --git a/CHANGELOG.md b/CHANGELOG.md index 77ba42d..ffbbe24 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,84 @@ # Changelog +## 2.9.0 (2020-07-03) + +A **major feature release** adding a new options APIs and more consistent APIs +for sending streaming requests. Includes a major documentation overhaul and +deprecates a number of APIs. + +* Feature: Add new `request()` and `requestStreaming()` methods and + deprecate `send()` method and `streaming` option. + (#170 by @clue) + + ```php + // old: deprecated + $browser->withOptions(['streaming' => true])->get($url); + $browser->send(new Request('OPTIONS', $url)); + + // new + $browser->requestStreaming('GET', $url); + $browser->request('OPTIONS', $url); + ``` + +* Feature: Add dedicated methods to control options, deprecate `withOptions()`. + (#172 by @clue) + + ```php + // old: deprecated + $browser->withOptions(['timeout' => 10]); + $browser->withOptions(['followRedirects' => false]); + $browser->withOptions(['obeySuccessCode' => false]); + + // new + $browser->withTimeout(10); + $browser->withFollowRedirects(false); + $browser->withRejectErrorResponse(false); + ``` + +* Feature: Add `withResponseBuffer()` method to limit maximum response buffer size (defaults to 16 MiB). + (#175 by @clue) + + ```php + // new: download maximum of 100 MB + $browser->withResponseBuffer(100 * 1000000)->get($url); + ``` + +* Feature: Improve `withBase()` method and deprecate `withoutBase()` method + (#173 by @clue) + + ```php + // old: deprecated + $browser = $browser->withoutBase(); + + // new + $browser = $browser->withBase(null); + ``` + +* Deprecate `submit()` method, use `post()` instead. + (#171 by @clue) + + ```php + // old: deprecated + $browser->submit($url, $data); + + // new + $browser->post($url, ['Content-Type' => 'application/x-www-form-urlencoded'], http_build_query($data)); + ``` + +* Deprecate `UriInterface` for request methods, use URL strings instead + (#174 by @clue) + +* Fix: Fix unneeded timeout timer when request body closes and sender already rejected. + (#169 by @clue) + +* Improve documentation structure, add documentation for all API methods and + handling concurrency. + (#167 and #176 by @clue) + +* Improve test suite to use ReactPHP-based webserver instead of httpbin and + add forward compatibility with PHPUnit 9. + (#168 by @clue) + ## 2.8.2 (2020-06-02) * Fix: HTTP `HEAD` requests should not expect a response body. diff --git a/README.md b/README.md index 31907c8..f2fd939 100644 --- a/README.md +++ b/README.md @@ -1388,7 +1388,7 @@ This project follows [SemVer](https://semver.org/). This will install the latest supported version: ```bash -$ composer require clue/buzz-react:^2.8.2 +$ composer require clue/buzz-react:^2.9 ``` See also the [CHANGELOG](CHANGELOG.md) for details about version upgrades.