PHP code example of aweitian / httpclient

1. Go to this page and download the library: Download aweitian/httpclient 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/ */

    

aweitian / httpclient example snippets


$http_client = new \Aw\Httpclient\Curl();
$html = $http_client->get("https://baidu.com/")
->setOption(CURLOPT_TIMEOUT,30)
...
->send();
$response_headers = $http_client->headers_response