From d4e7633a38fe80940417f60e9f2ef0236ea52aaa Mon Sep 17 00:00:00 2001 From: Peter Smith Date: Sun, 5 Sep 2021 13:06:58 -0700 Subject: [PATCH] document how to set a response timeout i'm not sure where i found this info, but it was one of the first things i went looking for, and couldn't find it in the docs, or api docs. prob found here: https://requests.ryanmccue.info/api/source-class-Requests.html#308 --- docs/usage-advanced.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/usage-advanced.md b/docs/usage-advanced.md index 114a3fa90..781dc90a5 100644 --- a/docs/usage-advanced.md +++ b/docs/usage-advanced.md @@ -70,6 +70,21 @@ bugs in PHP for more information on Subject Alternate Name field. [php-bug-47030]: https://php.net/47030 [php-bug-55820]: https://php.net/55820 + +Set a Timeout for Requests +-------------------------- +Set a response timeout for Requests: + +```php +$options = array( + 'connect_timeout' => 60, // How long should we wait while trying to connect? + 'timeout' => 60 // How long should we wait for a response? +); +$response = Requests::get('https://httpbin.org/', array(), $options); +``` + + + *** Previous: [Making a request](usage.md)