v2.5.0
-
Feature: Add HTTP timeout option.
(#114 by @Rakdar and @clue)This now respects PHP's
default_socket_timeoutsetting (default 60s) as a
timeout for sending the outgoing HTTP request and waiting for a successful
response and will otherwise cancel the pending request and reject its value
with an Exception. You can now use thetimeoutoption to
pass a custom timeout value in seconds like this:$browser = $browser->withOptions(array( 'timeout' => 10.0 )); $browser->get($uri)->then(function (ResponseInterface $response) { // response received within 10 seconds maximum var_dump($response->getHeaders()); });
Similarly, you can use a negative timeout value to not apply a timeout at
all or use anullvalue to restore the default handling. -
Improve documentation for
withOptions()and
add documentation and example for HTTP CONNECT proxy.
(#111 and #115 by @clue) -
Refactor
Browserto reuse singleTransactioninstance internally
which now accepts sending individual requests and their options.
(#113 by @clue)