$client = new HttpClient('baidu.com'); if (!$client->get('/')) { die('An error occurred: '.$client->getError()); } print_r($client->getHeaders());