|
|
@ -7,17 +7,13 @@ |
|
|
|
<p>If you would like to setup timeout and retry options, as discussed in the |
|
|
|
<a href="../reliability_tips/">reliability tips section</a>, there is a |
|
|
|
<a href="https://www.phpcurlclass.com/">curl package</a> available that lets you do that easily:</p> |
|
|
|
<p>```php startinline=True |
|
|
|
use Curl\Curl;</p> |
|
|
|
<p>$curl = new Curl(); |
|
|
|
$curl->setRetry(20); |
|
|
|
$curl->setTimeout(5); |
|
|
|
$curl->get('PING_URL'); |
|
|
|
```</p> |
|
|
|
<p>:::php |
|
|
|
use Curl\Curl; |
|
|
|
$curl = new Curl(); |
|
|
|
$curl->setRetry(20); |
|
|
|
$curl->setTimeout(5); |
|
|
|
$curl->get('PING_URL');</p> |
|
|
|
<div class="highlight"><pre><span></span><code><span class="x">use Curl\Curl;</span> |
|
|
|
|
|
|
|
<span class="x">$curl = new Curl();</span> |
|
|
|
<span class="x">$curl->setRetry(20);</span> |
|
|
|
<span class="x">$curl->setTimeout(5);</span> |
|
|
|
<span class="x">$curl->get('PING_URL');</span> |
|
|
|
</code></pre></div> |
|
|
|
|
|
|
|
|
|
|
|
<p>Note: this code never throws any exception.</p> |