1. Go to this page and download the library: Download apimatic/unirest-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
apimatic / unirest-php example snippets
private $httpClient = new \Unirest\HttpClient();
$configurations = \Unirest\Configuration::init()
->timeout(10)
->enableRetries(true)
->retryInterval(2.5);
$httpClient = new \Unirest\HttpClient($configurations);
$configuration = Configuration::init()
->enableRetries(true) // To enable retries feature
->maxNumberOfRetries(10) // To set max number of retries
->retryOnTimeout(false) // Should we retry on timeout
->retryInterval(20) // Initial retry interval in seconds
->maximumRetryWaitTime(30) // Maximum retry wait time
->backoffFactor(1.1) // Backoff factor to be used to increase retry interval
->httpStatusCodesToRetry([400,401]) // Http status codes to retry against
->httpMethodsToRetry(['POST']) // Http methods to retry against
// quick setup with default port: 1080
$configuration = Configuration::init()
->proxy('10.10.10.1');
// custom port and proxy type
$configuration = Configuration::init()
->proxy('10.10.10.1', 8080, CURLPROXY_HTTP);
// enable tunneling
$configuration = Configuration::init()
->proxy('10.10.10.1', 8080, CURLPROXY_HTTP, true);