|
1 | 1 | # Changelog |
2 | 2 |
|
| 3 | +## 2.9.0 (2020-07-03) |
| 4 | + |
| 5 | +A **major feature release** adding a new options APIs and more consistent APIs |
| 6 | +for sending streaming requests. Includes a major documentation overhaul and |
| 7 | +deprecates a number of APIs. |
| 8 | + |
| 9 | +* Feature: Add new `request()` and `requestStreaming()` methods and |
| 10 | + deprecate `send()` method and `streaming` option. |
| 11 | + (#170 by @clue) |
| 12 | + |
| 13 | + ```php |
| 14 | + // old: deprecated |
| 15 | + $browser->withOptions(['streaming' => true])->get($url); |
| 16 | + $browser->send(new Request('OPTIONS', $url)); |
| 17 | + |
| 18 | + // new |
| 19 | + $browser->requestStreaming('GET', $url); |
| 20 | + $browser->request('OPTIONS', $url); |
| 21 | + ``` |
| 22 | + |
| 23 | +* Feature: Add dedicated methods to control options, deprecate `withOptions()`. |
| 24 | + (#172 by @clue) |
| 25 | + |
| 26 | + ```php |
| 27 | + // old: deprecated |
| 28 | + $browser->withOptions(['timeout' => 10]); |
| 29 | + $browser->withOptions(['followRedirects' => false]); |
| 30 | + $browser->withOptions(['obeySuccessCode' => false]); |
| 31 | + |
| 32 | + // new |
| 33 | + $browser->withTimeout(10); |
| 34 | + $browser->withFollowRedirects(false); |
| 35 | + $browser->withRejectErrorResponse(false); |
| 36 | + ``` |
| 37 | + |
| 38 | +* Feature: Add `withResponseBuffer()` method to limit maximum response buffer size (defaults to 16 MiB). |
| 39 | + (#175 by @clue) |
| 40 | + |
| 41 | + ```php |
| 42 | + // new: download maximum of 100 MB |
| 43 | + $browser->withResponseBuffer(100 * 1000000)->get($url); |
| 44 | + ``` |
| 45 | + |
| 46 | +* Feature: Improve `withBase()` method and deprecate `withoutBase()` method |
| 47 | + (#173 by @clue) |
| 48 | + |
| 49 | + ```php |
| 50 | + // old: deprecated |
| 51 | + $browser = $browser->withoutBase(); |
| 52 | + |
| 53 | + // new |
| 54 | + $browser = $browser->withBase(null); |
| 55 | + ``` |
| 56 | + |
| 57 | +* Deprecate `submit()` method, use `post()` instead. |
| 58 | + (#171 by @clue) |
| 59 | + |
| 60 | + ```php |
| 61 | + // old: deprecated |
| 62 | + $browser->submit($url, $data); |
| 63 | + |
| 64 | + // new |
| 65 | + $browser->post($url, ['Content-Type' => 'application/x-www-form-urlencoded'], http_build_query($data)); |
| 66 | + ``` |
| 67 | + |
| 68 | +* Deprecate `UriInterface` for request methods, use URL strings instead |
| 69 | + (#174 by @clue) |
| 70 | + |
| 71 | +* Fix: Fix unneeded timeout timer when request body closes and sender already rejected. |
| 72 | + (#169 by @clue) |
| 73 | + |
| 74 | +* Improve documentation structure, add documentation for all API methods and |
| 75 | + handling concurrency. |
| 76 | + (#167 and #176 by @clue) |
| 77 | + |
| 78 | +* Improve test suite to use ReactPHP-based webserver instead of httpbin and |
| 79 | + add forward compatibility with PHPUnit 9. |
| 80 | + (#168 by @clue) |
| 81 | + |
3 | 82 | ## 2.8.2 (2020-06-02) |
4 | 83 |
|
5 | 84 | * Fix: HTTP `HEAD` requests should not expect a response body. |
|
0 commit comments