/** * Header constructor. * * @param HttpClient $client * @param string $response */ public function __construct(HttpClient $client, string $response) { if ($client->isEnabled(CURLOPT_HEADER)) { $this->size = (int) $client->getInfo(CURLINFO_HEADER_SIZE); $this->extractHeader($response); } }
/** * Status constructor. * * @param HttpClient $client */ public function __construct(HttpClient $client) { $this->info = $client->getInfo(); }
<?php use Dgame\HttpClient\HttpClient; require_once 'vendor/autoload.php'; print '<pre>'; $client = new HttpClient(); $request = $client->get('http://httpbin.org/get'); print_r($request); $response = $request->send(); print_r($response);