PHP code example of appzz / curl-client
1. Go to this page and download the library: Download appzz/curl-client 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/ */
appzz / curl-client example snippets
$request = CurlClient::get ('https://github.com')
->http2()
->ipv6()
->browser('chrome', 'mac');
$response = $request->send();
//Get response status
$status = $response->get_status();
//Get body
$body = $response->get_body();
//Get request headers
$request->get_headers()->asArray();
//Get response headers
$headers = $response->get_headers()->asArray();
//Get cookies
$cookies = $headers->offsetGet ('cookies');
var_dump ($cookies->asArray()); //as array
echo $cookies; // as url-encoded string