public function get_response_header($header = null)
{
if ($header) {
return $this->response_headers[strtolower($header)];
}
return $this->response_headers;
}
public function testGetParseTrue() { $httpCore = new RequestCore("http://www.baidu.com"); $httpCore->curlopts = array(CURLOPT_HEADER => true); $url = $httpCore->send_request(true); foreach ($httpCore->get_response_header() as $key => $value) { $this->assertEquals($httpCore->get_response_header($key), $value); } $this->assertNotNull($url); }