Exemplo n.º 1
0
 /**
  * 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);
     }
 }
Exemplo n.º 2
0
 /**
  * Status constructor.
  *
  * @param HttpClient $client
  */
 public function __construct(HttpClient $client)
 {
     $this->info = $client->getInfo();
 }
Exemplo n.º 3
0
<?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);